mirror of https://github.com/mpv-player/mpv
video: fix attached picture mode
Playing audio files with embedded cover art broke due to some of the recent changes. Treat video EOF properly, and don't burn the CPU. Disable hrseek for video in attached picture mode, since the decoder will always produce a new image, which makes hrseek never terminate. Fixes #970.
This commit is contained in:
parent
4cf3f3ca2c
commit
de8e9ca9d2
|
@ -505,7 +505,8 @@ static int video_output_image(struct MPContext *mpctx, double endpts,
|
|||
add_frame_pts(mpctx, pts);
|
||||
|
||||
bool drop = false;
|
||||
bool hrseek = mpctx->hrseek_active && mpctx->video_status == STATUS_SYNCING;
|
||||
bool hrseek = mpctx->hrseek_active && mpctx->video_status == STATUS_SYNCING
|
||||
&& !mpctx->d_video->header->attached_picture;
|
||||
if (hrseek && pts < mpctx->hrseek_pts - .005)
|
||||
drop = true;
|
||||
if (endpts != MP_NOPTS_VALUE && pts >= endpts) {
|
||||
|
@ -751,6 +752,7 @@ void write_video(struct MPContext *mpctx, double endpts)
|
|||
mpctx->last_av_difference = 0;
|
||||
mpctx->video_status = STATUS_EOF;
|
||||
MP_VERBOSE(mpctx, "video EOF\n");
|
||||
return;
|
||||
} else {
|
||||
if (mpctx->video_status > STATUS_PLAYING)
|
||||
mpctx->video_status = STATUS_PLAYING;
|
||||
|
|
Loading…
Reference in New Issue