[MPlayer-cvslog] r33448 - trunk/gui/mplayer/gui_common.c

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun May 22 12:56:08 CEST 2011


On Fri, May 13, 2011 at 03:22:27PM +0200, Ingo Brückl wrote:
> I wrote on Tue, 10 May 2011 20:58:08 +0200:
> 
> > Reimar Döffinger wrote on Tue, 10 May 2011 18:38:13 +0200:
> 
> >> On Tue, May 10, 2011 at 12:59:18PM +0200, Ingo Brückl wrote:
> >>> Reimar Döffinger wrote on Mon, 9 May 2011 20:33:28 +0200:
> >>>
> >>> > On 9 May 2011, at 13:17, ib <subversion at mplayerhq.hu> wrote:
> >>> >> Author: ib
> >>> >> Date: Mon May  9 13:17:43 2011
> >>> >> New Revision: 33448
> >>> >>
> >>> >> Log:
> >>> >> Check for reasonable time values.
> >>> >>
> >>> >> Some A/V files don't provide reasonable time information in which case
> >>> >> the GUI produces a junk dlabel, so set values to zero.
> >>>
> 
> >> Yes, but why is that so?
> 
> > That's beyond my knowledge.
> 
> But fortunately my knowledge improves. :-)
> 
> >> This seems likely to be a demuxer bug and it would be a good idea to fix
> >> that bug and not _only_ "sweep it under the rug".
> 
> > I certainly have no idea [...]
> 
> Now I have.
> 
> After reading http://msdn.microsoft.com/en-us/library/aa368932(v=vs.85).aspx
> I found a bug in libmpdemux/asfheader.c.
> 
> Ingo

> Index: libmpdemux/asfheader.c
> ===================================================================
> --- libmpdemux/asfheader.c	(revision 33464)
> +++ libmpdemux/asfheader.c	(working copy)
> @@ -543,7 +543,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-10000*fileh->preroll)/10000000.0;
> +      if (fileh->play_duration>10000*fileh->preroll) asf->movielength=(fileh->play_duration-10000*fileh->preroll)/10000000.0;
> +      else asf->movielength=0;

Isn't it equivalent and more obvious to do
asf->movielength=FFMAX((fileh->play_duration-10000*fileh->preroll)/10000000.0, 0.0);
for example?
Or in a separate line.
Just think it would be better to avoid duplicating the
10000*fileh->preroll stuff.


More information about the MPlayer-cvslog mailing list