[FFmpeg-devel] [PATCH] RTSP muxer, round 5

Martin Storsjö martin
Fri Feb 26 17:50:12 CET 2010


On Fri, 26 Feb 2010, Ronald S. Bultje wrote:

> On Fri, Feb 26, 2010 at 8:36 AM, Martin Storsj? <martin at martin.st> wrote:
> > ?av_write_frame(out, pkt);
> > ?double time = pkt->dts*av_q2d(out->streams[pkt->stream_index]->time_base);
> >
> > When pkt->stream_index initially was 1, but changed to 0 for the chained
> > internal muxer, this calculation turned out wrong. In this case, it was
> > easy to fix, but there may be a lot of other libavformat users out there
> > that could be struck by something similar.
> >
> > So, is it ok for av_write_frame to update fields of the AVPacket to
> > potentially bogus values, or should rtsp_write_packet be changed to set
> > stream_index to 0 in a local copy? Or perhaps just backup the index value
> > and restore the original value afterwards?
> 
> As Michael says, I guess I didn't think this through very carefully.
> Feel free to fix in SVN as necessary.

Fixed by using a local copy of the AVPacket.

// Martin



More information about the ffmpeg-devel mailing list