diff options
Diffstat (limited to 'src/decoder')
-rw-r--r-- | src/decoder/plugins/FfmpegDecoderPlugin.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index 965a479ad..aba1810d5 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -332,7 +332,14 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is, int len = avcodec_decode_audio4(codec_context, frame, &got_frame, &packet2); - if (len >= 0 && got_frame) { + if (len < 0) { + /* if error, we skip the frame */ + LogDefault(ffmpeg_domain, + "decoding failed, frame skipped"); + break; + } + + if (got_frame) { audio_size = copy_interleave_frame(codec_context, frame, &output_buffer, @@ -341,13 +348,6 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is, len = audio_size; } - if (len < 0) { - /* if error, we skip the frame */ - LogDefault(ffmpeg_domain, - "decoding failed, frame skipped"); - break; - } - packet2.data += len; packet2.size -= len; |