aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins/FfmpegDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-18 23:21:48 +0100
committerMax Kellermann <max@duempel.org>2014-12-18 23:21:48 +0100
commit49f6b50ed3676e35ef25a208b7ada9aaa806d54d (patch)
treec81ae450949a59268cef9cb33cda45af054a37f1 /src/decoder/plugins/FfmpegDecoderPlugin.cxx
parent0f2a304d34ded460862ad11d210e577cf7260eda (diff)
downloadmpd-49f6b50ed3676e35ef25a208b7ada9aaa806d54d.tar.gz
mpd-49f6b50ed3676e35ef25a208b7ada9aaa806d54d.tar.xz
mpd-49f6b50ed3676e35ef25a208b7ada9aaa806d54d.zip
decoder/ffmpeg: simplify ffmpeg_send_packet()
Diffstat (limited to 'src/decoder/plugins/FfmpegDecoderPlugin.cxx')
-rw-r--r--src/decoder/plugins/FfmpegDecoderPlugin.cxx30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
index 11b5e85f0..633be1565 100644
--- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
@@ -335,24 +335,24 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
break;
}
- uint8_t *output_buffer = nullptr;
- int audio_size = 0;
- if (got_frame) {
- audio_size = copy_interleave_frame(codec_context,
- frame,
- &output_buffer,
- buffer);
- if (audio_size < 0) {
- /* this must be a serious error,
- e.g. OOM */
- LogFfmpegError(audio_size);
- return DecoderCommand::STOP;
- }
- }
-
packet2.data += len;
packet2.size -= len;
+ if (!got_frame)
+ continue;
+
+ uint8_t *output_buffer = nullptr;
+ int audio_size =
+ copy_interleave_frame(codec_context, frame,
+ &output_buffer,
+ buffer);
+ if (audio_size < 0) {
+ /* this must be a serious error,
+ e.g. OOM */
+ LogFfmpegError(audio_size);
+ return DecoderCommand::STOP;
+ }
+
if (audio_size <= 0)
continue;