[MPlayer-cvslog] r33492 - trunk/libmpdemux/asfheader.c

ib subversion at mplayerhq.hu
Tue May 24 15:35:26 CEST 2011


Author: ib
Date: Tue May 24 15:35:26 2011
New Revision: 33492

Log:
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 determination (suggested by reimar) prevents
overflows as well.

Modified:
   trunk/libmpdemux/asfheader.c

Modified: trunk/libmpdemux/asfheader.c
==============================================================================
--- trunk/libmpdemux/asfheader.c	Tue May 24 10:20:48 2011	(r33491)
+++ trunk/libmpdemux/asfheader.c	Tue May 24 15:35:26 2011	(r33492)
@@ -543,7 +543,7 @@ int read_asf_header(demuxer_t *demuxer,s
       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


More information about the MPlayer-cvslog mailing list