From e11abdbad2fff17968c914212d5fd68d7536ddeb Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 24 Apr 2015 22:34:55 +0200 Subject: 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.) --- player/video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'player/video.c') diff --git a/player/video.c b/player/video.c index e96f7dad82..d35a9de011 100644 --- a/player/video.c +++ b/player/video.c @@ -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; -- cgit v1.2.3