mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 07:33:46 +01:00
core: ignore backstep command if demuxer is not capable
Also, mark demuxer as not capable if DVD playback is done. The problem with DVD is that playback time (stream_pts) is not reported frame-exact, and the time is a "guess" at best.
This commit is contained in:
parent
e5f18eb825
commit
e4837b2d42
@ -3590,7 +3590,8 @@ static void run_playloop(struct MPContext *mpctx)
|
||||
if (mpctx->backstep_active) {
|
||||
double current_pts = mpctx->last_vo_pts;
|
||||
mpctx->backstep_active = false;
|
||||
if (mpctx->sh_video && current_pts != MP_NOPTS_VALUE) {
|
||||
bool demuxer_ok = mpctx->demuxer && mpctx->demuxer->accurate_seek;
|
||||
if (demuxer_ok && mpctx->sh_video && current_pts != MP_NOPTS_VALUE) {
|
||||
double seek_pts = find_previous_pts(mpctx, current_pts);
|
||||
if (seek_pts != MP_NOPTS_VALUE) {
|
||||
queue_seek(mpctx, MPSEEK_ABSOLUTE, seek_pts, 1);
|
||||
@ -3617,9 +3618,11 @@ static void run_playloop(struct MPContext *mpctx)
|
||||
// Note that current_pts should be part of the index,
|
||||
// otherwise we can't find the previous frame, so set the
|
||||
// seek target an arbitrary amount of time after it.
|
||||
mpctx->hrseek_pts = current_pts + 10.0;
|
||||
mpctx->hrseek_framedrop = false;
|
||||
mpctx->backstep_active = true;
|
||||
if (mpctx->hrseek_active) {
|
||||
mpctx->hrseek_pts = current_pts + 10.0;
|
||||
mpctx->hrseek_framedrop = false;
|
||||
mpctx->backstep_active = true;
|
||||
}
|
||||
} else {
|
||||
mpctx->backstep_active = true;
|
||||
}
|
||||
|
@ -925,6 +925,8 @@ static struct demuxer *open_given_type(struct MPOpts *opts,
|
||||
if (stream_manages_timeline(demuxer->stream)) {
|
||||
// Incorrect, but fixes some behavior with DVD/BD
|
||||
demuxer->ts_resets_possible = false;
|
||||
// Doesn't work, because stream_pts is a "guess".
|
||||
demuxer->accurate_seek = false;
|
||||
}
|
||||
demuxer_sort_chapters(demuxer);
|
||||
return demuxer;
|
||||
|
Loading…
Reference in New Issue
Block a user