player: flush decoder even if cover art is decoded

Fixes PNG cover art not showing up immediately (for example when running
with --pause).

libavformat exports embedded cover art as a single packet. For example,
a PNG attachment simply contains the PNG image, which can be sent to the
decoder. Normally you would expect that the PNG decoder would return 1
frame for 1 packet, without any delays. But this stopped working, and it
incurs a 1 frame delay.

This is perfectly legal (even if unexpected), so let our code feed the
decoder packets until we get something back. (In theory feeding the
packet instead of a real flush packet is still somewhat questionable.)
This commit is contained in:
wm4 2015-04-24 22:34:55 +02:00
parent 8d31ad85ec
commit e11abdbad2
1 changed files with 1 additions and 1 deletions

View File

@ -377,7 +377,7 @@ static int decode_image(struct MPContext *mpctx)
if (d_video->header->attached_picture) {
d_video->waiting_decoded_mpi =
video_decode(d_video, d_video->header->attached_picture, 0);
return VD_EOF;
return d_video->waiting_decoded_mpi ? VD_EOF : VD_PROGRESS;
}
struct demux_packet *pkt;