[MPlayer-dev-eng] [PATCH] fix length in asf files
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Tue Nov 10 16:42:39 CET 2009
On Tue, Nov 10, 2009 at 10:07:48AM -0500, compn wrote:
> 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:
Looks unrelated/purely cosmetic to me.
And can be applied immediately I'd say.
> 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;
How about just
(fileh->play_duration - 10000*fileh->preroll) / 10000000.0
The different time-base are really strange though...
More information about the MPlayer-dev-eng
mailing list