Commit f8a9a7a1 authored by Max Kellermann's avatar Max Kellermann

decoder/ffmpeg: simplify ffmpeg_send_packet()

parent eb192137
......@@ -379,11 +379,15 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
break;
}
packet.data += len;
packet.size -= len;
if (!got_frame)
continue;
uint8_t *output_buffer = nullptr;
int audio_size = 0;
if (got_frame) {
audio_size = copy_interleave_frame(codec_context,
*frame,
int audio_size =
copy_interleave_frame(codec_context, *frame,
&output_buffer,
buffer);
if (audio_size < 0) {
......@@ -392,10 +396,6 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
LogFfmpegError(audio_size);
return DecoderCommand::STOP;
}
}
packet.data += len;
packet.size -= len;
if (audio_size <= 0)
continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment