summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-07-28 13:39:11 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-07-28 13:39:11 +0000
commitc3cdf1ced9b4becdfc215a7c6bb63b4c6ba22134 (patch)
tree98af9f232aed29a85aa65fdda3b51c7d952a4c6a /libmpdemux
parent66ee8ce70ac6877ed0cb1a0a6652ffbd87570b46 (diff)
downloadmpv-c3cdf1ced9b4becdfc215a7c6bb63b4c6ba22134.tar.bz2
mpv-c3cdf1ced9b4becdfc215a7c6bb63b4c6ba22134.tar.xz
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
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_lavf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index 4e6e639c08..8740dba104 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -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);