1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-01 12:22:22 +00:00

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
This commit is contained in:
ib 2011-05-24 13:35:26 +00:00 committed by Uoti Urpala
parent 4f4fae851d
commit f52b41600d

View File

@ -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