diff options
author | 2011-05-24 13:35:26 +0000 | |
---|---|---|
committer | 2011-07-06 07:23:26 +0300 | |
commit | f52b41600d32fb2f820a4387e79510a24aca7fe0 (patch) | |
tree | 7ce1ff7e56800ec7e1575821690f42dae28aa636 | |
parent | 4f4fae851dd2239c0ddc2a3d9dc785fa38a3fd1f (diff) |
demux_asf: Fix play duration calculation error
Acording to the ASF documentation, the play duration is zero
if the preroll value is greater than the play duration.
The new way of determining it (suggested by reimar) prevents
overflows as well.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33492 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libmpdemux/asfheader.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libmpdemux/asfheader.c b/libmpdemux/asfheader.c index 994c3e890d..857a899bef 100644 --- a/libmpdemux/asfheader.c +++ b/libmpdemux/asfheader.c @@ -542,7 +542,7 @@ int read_asf_header(demuxer_t *demuxer,struct asf_priv* asf){ asf->packetsize=fileh->max_packet_size; asf->packet=malloc(asf->packetsize); // !!! asf->packetrate=fileh->max_bitrate/8.0/(double)asf->packetsize; - asf->movielength=(fileh->play_duration-10000*fileh->preroll)/10000000.0; + asf->movielength=FFMAX(0.0, (fileh->play_duration / 10000.0 - fileh->preroll) / 1000.0); } // find content header |