[FFmpeg-devel] [PATCH] stream copy packet duration

Michael Niedermayer michaelni
Wed Jul 25 20:09:13 CEST 2007


Hi

On Wed, Jul 25, 2007 at 06:08:45PM +0200, Aurelien Jacobs wrote:
> On Wed, 25 Jul 2007 17:58:18 +0200
> Baptiste Coudurier <baptiste.coudurier at smartjog.com> wrote:
> 
> > Hi
> > 
> > Aurelien Jacobs wrote:
> > > Hi,
> > > 
> > > Attached patch allows to copy packet duration when doing a stream copy.
> > > This will be especially useful when stream copying subtitles.
> > > Ok to apply ?
> > > 
> > > [...]
> > >
> > > + opkt.duration = av_rescale_q(av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q), AV_TIME_BASE_Q,  ost->st->time_base);
> > >
> > 
> > Why not :
> > 
> > opkt.duration = av_rescale_q(pkt->duration, ist->st->time_base,
> > ost->st->time_base);
> 
> In fact I copied the way it's done for pts rescaling. But now that I think
> about it, it was done this way because an offset is added to the pts.
> And this offset must be relative to AV_TIME_BASE_Q.
> So for duration, your proposition should be fine.
> Updated patch attached.

looks ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070725/768ef106/attachment.pgp>



More information about the ffmpeg-devel mailing list