[FFmpeg-devel] [PATCH 6/6] lavf: count skipped samples for initial timestamps.
Michael Niedermayer
michaelni at gmx.at
Wed Jul 18 14:46:55 CEST 2012
On Sun, Jul 15, 2012 at 05:53:06PM +0200, Nicolas George wrote:
> If skip_samples is set and timestamps are synthesized using durations,
> make them start at -skip_samples (rescaled) instead of 0,
> so that the timestamp of the first undiscarded sample is 0.
>
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
> libavformat/utils.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index ae3a39a..98273ef 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -942,6 +942,10 @@ static void update_initial_durations(AVFormatContext *s, AVStream *st,
> AVPacketList *pktl= s->parse_queue ? s->parse_queue : s->packet_buffer;
> int64_t cur_dts= RELATIVE_TS_BASE;
>
> + if (st->skip_samples && st->codec->sample_rate && st->time_base.num)
> + cur_dts -= av_rescale_q(st->skip_samples,
> + (AVRational){ 1, st->codec->sample_rate },
> + st->time_base);
does this affect stream copy ?
i mean when stream copying something with skiped samples the
underlaying packet timestamps have to stay as they are
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
There will always be a question for which you do not know the correct awnser.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120718/05cf3ce6/attachment.asc>
More information about the ffmpeg-devel
mailing list