aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2015-04-24 22:34:55 +0200
committerGravatar wm4 <wm4@nowhere>2015-04-24 23:27:12 +0200
commite11abdbad2fff17968c914212d5fd68d7536ddeb (patch)
treeff392adc6a8a8256de60f36b6780039e5f4d74ed
parent8d31ad85ec0ec49cc7f7f72c330f3570e57ceffe (diff)
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.)
-rw-r--r--player/video.c2
1 files changed, 1 insertions, 1 deletions
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;