mirror of
https://github.com/mpv-player/mpv
synced 2024-12-27 01:22:30 +00:00
stream_dvdnav: make sure seeking bounds are within range
libdvdnav returns an error is the seek position is out of range. CC: @mpv-player/stable Signed-off-by: wm4 <wm4@nowhere>
This commit is contained in:
parent
fe4fbb5775
commit
4bd75313d1
@ -546,7 +546,11 @@ static int control(stream_t *stream, int cmd, void *arg)
|
||||
return STREAM_OK;
|
||||
}
|
||||
case STREAM_CTRL_SEEK_TO_TIME: {
|
||||
uint64_t tm = (uint64_t) (*((double *)arg) * 90000);
|
||||
int64_t tm = (int64_t) (*((double *)arg) * 90000);
|
||||
if (tm < 0)
|
||||
tm = 0;
|
||||
if (priv->duration && tm >= (priv->duration * 90))
|
||||
tm = priv->duration * 90 - 1;
|
||||
MP_VERBOSE(stream, "seek to PTS %"PRId64"\n", tm);
|
||||
if (dvdnav_time_search(dvdnav, tm) != DVDNAV_STATUS_OK)
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user