diff options
Diffstat (limited to 'dom')
-rw-r--r-- | dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp index fa36f00ae5..0cfe83e9ba 100644 --- a/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp +++ b/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp @@ -149,35 +149,35 @@ FFmpegAudioDecoder<LIBAV_VER>::DoDecode(MediaRawData* aSample) } #else #define AVRESULT_OK 0 - - int ret = mLib->avcodec_receive_frame(mCodecContext, mFrame); + int ret = mLib->avcodec_send_packet(mCodecContext, &packet); switch (ret) { case AVRESULT_OK: - decoded = true; + bytesConsumed = packet.size; break; case AVERROR(EAGAIN): break; - case AVERROR_EOF: { + case AVERROR_EOF: FFMPEG_LOG("End of stream."); return MediaResult(NS_ERROR_DOM_MEDIA_END_OF_STREAM, RESULT_DETAIL("End of stream")); - } + default: + NS_WARNING("FFmpeg audio decoder error."); + return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, + RESULT_DETAIL("FFmpeg audio error")); } - ret = mLib->avcodec_send_packet(mCodecContext, &packet); + + ret = mLib->avcodec_receive_frame(mCodecContext, mFrame); switch (ret) { case AVRESULT_OK: - bytesConsumed = packet.size; + decoded = true; break; case AVERROR(EAGAIN): break; - case AVERROR_EOF: + case AVERROR_EOF: { FFMPEG_LOG("End of stream."); return MediaResult(NS_ERROR_DOM_MEDIA_END_OF_STREAM, RESULT_DETAIL("End of stream")); - default: - NS_WARNING("FFmpeg audio decoder error."); - return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, - RESULT_DETAIL("FFmpeg audio error")); + } } #endif |