[FFmpeg-devel] [PATCH] ffserver rtsp bug fixes

Martin Storsjö martin
Mon May 24 23:00:58 CEST 2010


On Mon, 17 May 2010, Howard Chu wrote:

> > Index: ffserver.c
> > ===================================================================
> > --- ffserver.c	(revision 22902)
> > +++ ffserver.c	(working copy)
> > @@ -2210,14 +2210,18 @@
> >  static int64_t get_packet_send_clock(HTTPContext *c)
> >  {
> >      int bytes_left, bytes_sent, frame_bytes;
> > +    int64_t pts = c->cur_pts;
> > 
> > +    if (pts >= c->first_pts)
> > +        pts -= c->first_pts;
> > +
> >      frame_bytes = c->cur_frame_bytes;
> >      if (frame_bytes <= 0)
> > -        return c->cur_pts;
> > +        return pts;
> >      else {
> >          bytes_left = c->buffer_end - c->buffer_ptr;
> >          bytes_sent = frame_bytes - bytes_left;
> > -        return c->cur_pts + (c->cur_frame_duration * bytes_sent) /
> > frame_bytes;
> > +        return pts + (c->cur_frame_duration * bytes_sent) / frame_bytes;
> >      }
> >  }
> > 
> When I was streaming an flv from ffmpeg to ffserver I saw that the first
> frames had absolute timestamps of the current real time. All subsequent
> packets only had relative timestamps. In http_send_data() a packet will only
> get sent if the packet timestamp is older than the current server time, but
> the server time is also checked as a relative timestamp. This check turned
> into (1234567890000 > 0) so no RTP packets were ever sent. This patch makes
> sure that only relative timestamps are returned from get_packet_send_clock.

I don't think this is the correct fix here.

Baptiste, do you think the attached solution is acceptable?

// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ffserver-Set-cur_pts-to-0-if-no-start-time-is-availa.patch
Type: text/x-diff
Size: 1230 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100525/34f38fd2/attachment.patch>



More information about the ffmpeg-devel mailing list