decoder/ffmpeg: ignore empty packets

An empty packet would be a command for avcodec_send_packet() to
finalize the codec.

Fixes https://bugs.musicpd.org/view.php?id=4588
This commit is contained in:
Max Kellermann 2016-10-26 18:06:56 +02:00
parent 9c1c180ae0
commit 77a9940461
2 changed files with 3 additions and 1 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.19.20 (not yet released) ver 0.19.20 (not yet released)
* decoder
- ffmpeg: ignore empty packets
ver 0.19.19 (2016/08/23) ver 0.19.19 (2016/08/23)
* decoder * decoder

View File

@ -643,7 +643,7 @@ FfmpegDecode(Decoder &decoder, InputStream &input,
/* end of file */ /* end of file */
break; break;
if (packet.stream_index == audio_stream) { if (packet.size > 0 && packet.stream_index == audio_stream) {
cmd = ffmpeg_send_packet(decoder, input, cmd = ffmpeg_send_packet(decoder, input,
packet, packet,
*codec_context, *codec_context,