mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 12:02:23 +02:00
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.)
This commit is contained in:
parent
52d336e4c1
commit
e8355597f3
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user