# HG changeset patch # User ib # Date 1306244126 0 # Node ID 7dfe52e4f2e1dca2ee31fe7436467bd2f3f56848 # Parent 02ef77592b7d0a0257f807015bcfaee1120bfc87 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. diff -r 02ef77592b7d -r 7dfe52e4f2e1 libmpdemux/asfheader.c --- a/libmpdemux/asfheader.c Tue May 24 08:20:48 2011 +0000 +++ b/libmpdemux/asfheader.c Tue May 24 13:35:26 2011 +0000 @@ -543,7 +543,7 @@ 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