diff options
author | wm4 <wm4@nowhere> | 2015-01-19 20:45:31 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-01-19 21:26:48 +0100 |
commit | 966f0a41a4182cf4027a5d49b248a26ff49368f3 (patch) | |
tree | c1c004fdb38ff443b16b44a3f505ddbd81b55f1e /player/playloop.c | |
parent | e972ff4857d6b7f6cd8240e199185fca39d5ea47 (diff) | |
download | mpv-966f0a41a4182cf4027a5d49b248a26ff49368f3.tar.bz2 mpv-966f0a41a4182cf4027a5d49b248a26ff49368f3.tar.xz |
demux_disc: pass seek flags to stream layer
Pass through the seek flags to the stream layer. The STREAM_CTRL
semantics become a bit awkward, but that's still the least awkward
part about optical disc media.
Make demux_disc.c request relative seeks. Now the player will use
relative seeks if the user sends relative seek commands, and the
demuxer announces it wants these by setting rel_seeks to true. This
change probably changes seek behavior for dvd, dvdnav, bluray, cdda,
and possibly makes seeking useless if the demuxer-cache is set to
a high value.
Will be used in the next commit. (Split to make reverting the next
commit easier.)
Diffstat (limited to 'player/playloop.c')
-rw-r--r-- | player/playloop.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/player/playloop.c b/player/playloop.c index cabdb4e441..bcec02e21a 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -204,7 +204,7 @@ static int mp_seek(MPContext *mpctx, struct seek_params seek, } } int direction = 0; - if (seek.type == MPSEEK_RELATIVE) { + if (seek.type == MPSEEK_RELATIVE && (!mpctx->demuxer->rel_seeks || hr_seek)) { seek.type = MPSEEK_ABSOLUTE; direction = seek.amount > 0 ? 1 : -1; seek.amount += get_current_time(mpctx); @@ -233,10 +233,13 @@ static int mp_seek(MPContext *mpctx, struct seek_params seek, demuxer_style |= SEEK_ABSOLUTE; break; } - if (hr_seek || direction < 0) + if (hr_seek || direction < 0) { demuxer_style |= SEEK_BACKWARD; - else if (direction > 0) + } else if (direction > 0) { demuxer_style |= SEEK_FORWARD; + } + if (hr_seek) + demuxer_style |= SEEK_HR; if (hr_seek || opts->mkv_subtitle_preroll) demuxer_style |= SEEK_SUBPREROLL; |