mirror of
https://github.com/mpv-player/mpv
synced 2025-01-30 03:32:50 +00:00
Do not treat AV_NOPTS_VALUE as a valid duration value.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19212 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
66ee8ce70a
commit
c3cdf1ced9
@ -394,14 +394,14 @@ static int demux_lavf_control(demuxer_t *demuxer, int cmd, void *arg)
|
||||
|
||||
switch (cmd) {
|
||||
case DEMUXER_CTRL_GET_TIME_LENGTH:
|
||||
if (priv->avfc->duration == 0)
|
||||
if (priv->avfc->duration == 0 || priv->avfc->duration == AV_NOPTS_VALUE)
|
||||
return DEMUXER_CTRL_DONTKNOW;
|
||||
|
||||
*((double *)arg) = (double)priv->avfc->duration / AV_TIME_BASE;
|
||||
return DEMUXER_CTRL_OK;
|
||||
|
||||
case DEMUXER_CTRL_GET_PERCENT_POS:
|
||||
if (priv->avfc->duration == 0)
|
||||
if (priv->avfc->duration == 0 || priv->avfc->duration == AV_NOPTS_VALUE)
|
||||
return DEMUXER_CTRL_DONTKNOW;
|
||||
|
||||
*((int *)arg) = (int)((priv->last_pts - priv->avfc->start_time)*100 / priv->avfc->duration);
|
||||
|
Loading…
Reference in New Issue
Block a user