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:
wm4 2016-03-11 20:55:47 +01:00
parent 52d336e4c1
commit e8355597f3
1 changed files with 1 additions and 3 deletions

View File

@ -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;
}