[MPlayer-dev-eng] [PATCH] Read pts for VCD in demux_mpg.c

Giacomo Comes comes at naic.edu
Tue Feb 27 17:50:45 CET 2007


On Tue, Feb 27, 2007 at 12:35:56PM -0400, Giacomo Comes wrote:
> On Tue, Feb 27, 2007 at 05:16:25PM +0100, Nico Sabbi wrote:
> > Nico Sabbi wrote:
> > 
> > >Nico Sabbi wrote:
> > >
> > >>
> > >>>    {
> > >>>@@ -195,7 +196,7 @@
> > >>>      float first_pts = read_first_mpeg_pts_at_position(demuxer, 
> > >>>demuxer->movi_start);
> > >>>      if(first_pts != -1.0)
> > >>>      {
> > >>>-        float middle_pts = read_first_mpeg_pts_at_position(demuxer, 
> > >>>(demuxer->movi_end - demuxer->movi_start)/2);
> > >>>+        float middle_pts = read_first_mpeg_pts_at_position(demuxer, 
> > >>>(demuxer->movi_end + demuxer->movi_start)/2);
> > >>> 
> > >>>
> > >>
> > >>am I blind or this is cosmetics?
> > >>
> > >sorry, rethorical question :(
> > 
> > 
> > yet, the general notion of middle is (end-start)/2 ; why do you want to 
> > change it to (end+start)/2 ?
> 
> (end-start)/2 is the distance of the middle from start
> (end+start)/2 is the absolute value of middle.
 
Forget the following nonsense 4 text lines. Proper value is anyway (end+start)/2.
Giacomo

> The way middle is used:
> float proportion = (middle_pts-first_pts==0) ? -1 : (final_pts-middle_pts)/(middle_pts-first_pts);
> 
> suggest that the proper value to use is (end+start)/2.



More information about the MPlayer-dev-eng mailing list