From e8355597f3de10d7590117742866a313d8423a52 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 11 Mar 2016 20:55:47 +0100 Subject: dec_video: always redisplay cover art after a seek Instead of displaying it only on playback start (or after switching tracks), always display it even after a seek. This helps with --lavfi-complex. You can now overlay e.g. audio visualizations over cover art, and it won't break after a seek. The downside is that this might make seeks with huge cover art slower. There is also a glitch on seeking: since cover art pictures always have timestamp 0, the playback time will be 0 for a moment after seek, and then revert to audio PTS (as video is considered EOF). This is also due to how lavfi's overlay filter behaves. (I'm not sure how to tell lavfi that it's just a single frame.) --- video/decode/dec_video.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'video/decode') diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c index 93a68dc468..2a6a3ec213 100644 --- a/video/decode/dec_video.c +++ b/video/decode/dec_video.c @@ -370,12 +370,10 @@ void video_work(struct dec_video *d_video) // Might need flush. if (!d_video->cover_art_mpi) d_video->cover_art_mpi = decode_packet(d_video, NULL, 0); - d_video->current_state = DATA_OK; talloc_free(packet); } - if (d_video->current_state == DATA_OK) + if (d_video->current_state != DATA_EOF) d_video->current_mpi = mp_image_new_ref(d_video->cover_art_mpi); - // (DATA_OK is returned the first time, when current_mpi is sill set) d_video->current_state = DATA_EOF; return; } -- cgit v1.2.3