Index: libmpdemux/demux_asf.c =================================================================== --- libmpdemux/demux_asf.c (revision 29165) +++ libmpdemux/demux_asf.c (working copy) @@ -594,7 +594,7 @@ */ switch(cmd) { case DEMUXER_CTRL_GET_TIME_LENGTH: - *((double *)arg)=(double)(asf->movielength); + *((double *)arg)=asf->movielength; return DEMUXER_CTRL_OK; case DEMUXER_CTRL_GET_PERCENT_POS: Index: libmpdemux/asf.h =================================================================== --- libmpdemux/asf.h (revision 29165) +++ libmpdemux/asf.h (working copy) @@ -204,7 +204,7 @@ int scrambling_b; unsigned packetsize; double packetrate; - unsigned movielength; + double movielength; int asf_is_dvr_ms; uint32_t asf_frame_state; int asf_frame_start_found; Index: libmpdemux/asfheader.c =================================================================== --- libmpdemux/asfheader.c (revision 29165) +++ libmpdemux/asfheader.c (working copy) @@ -527,7 +527,8 @@ 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-fileh->preroll)/10000000LL; + asf->movielength=(double)fileh->play_duration/10000000 - + (double)fileh->preroll/1000; } // find content header