summaryrefslogtreecommitdiffstats
path: root/video/decode
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-03-11 20:55:47 +0100
committerwm4 <wm4@nowhere>2016-03-11 20:58:13 +0100
commite8355597f3de10d7590117742866a313d8423a52 (patch)
tree1c6cd29f213271de954515ebd38760a63c09d4a8 /video/decode
parent52d336e4c1f6345b43815b26373b9068e1c464a3 (diff)
downloadmpv-e8355597f3de10d7590117742866a313d8423a52.tar.bz2
mpv-e8355597f3de10d7590117742866a313d8423a52.tar.xz
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.)
Diffstat (limited to 'video/decode')
-rw-r--r--video/decode/dec_video.c4
1 files changed, 1 insertions, 3 deletions
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;
}