[Ffmpeg-devel] [PATCH] RTP/Get Duration of file (for seeking in stream)

Guillaume POIRIER poirierg
Mon Nov 6 20:08:51 CET 2006


Hi,

On 11/6/06, Michael Niedermayer <michaelni at gmx.at> wrote:
> Hi
>
> On Mon, Nov 06, 2006 at 11:39:27AM -0600, Ryan Martell wrote:
> > Hi--
> >
> > Attached is a patch to rtsp.c that will fill in the start and
> > duration of a movie (if known) from the sdp so that the seeking
> > function of rtsp will work.
> >
> > Thanks!
> > -Ryan
>
> > Index: libavformat/rtsp.c
> > ===================================================================
> > --- libavformat/rtsp.c        (revision 6890)
> > +++ libavformat/rtsp.c        (working copy)
> > @@ -345,6 +345,28 @@
> >      }
> >  }
> >
> > +static void rtsp_parse_range_npt(const char *p, int64_t *start, int64_t *end)
> > +{

Please add doxygen comments to this function (yeah, I know the
original function didn't have comments, but let's improve code
documentation while we are at it.
;-)


> > +            // this is so that seeking on a streamed file can work.
> > +            rtsp_parse_range_npt(p, &start, &end);
> > +            s->start_time= start;
> > +            s->duration= end - start;
>
> duration should be under if(end != AV_NOPTS_VALUE) otherwise it could
> end up with a weird value
>
> and ideally rtsp_parse_range_npt() should be moved in a seperate patch&commit
> but iam ok with it in the same patch too, its small and fairly readable

Ryan, please fix this and add doxy comments and I'll apply your patch.

Guillaume
-- 
With DADVSI (http://en.wikipedia.org/wiki/DADVSI), France finally has
a lead on USA on selling out individuals right to corporations!
Vive la France!




More information about the ffmpeg-devel mailing list