[FFmpeg-devel] [PATCH] avformat/concatdec: Handle NOPTS start_time
Michael Niedermayer
michaelni at gmx.at
Mon Dec 15 20:21:52 CET 2014
On Mon, Dec 15, 2014 at 06:53:19PM +0100, Nicolas George wrote:
> Le quintidi 25 frimaire, an CCXXIII, Michael Niedermayer a écrit :
> > Lines: 36
> >
> > Fixes Ticket3598
> >
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> > libavformat/concatdec.c | 11 ++++++++---
> > 1 file changed, 8 insertions(+), 3 deletions(-)
> >
> > diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
> > index a2584d7..253951a 100644
> > --- a/libavformat/concatdec.c
> > +++ b/libavformat/concatdec.c
> > @@ -512,9 +512,14 @@ static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt)
> > av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &st->time_base),
> > av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &st->time_base));
> >
> > - delta = av_rescale_q(cat->cur_file->start_time - cat->avf->start_time,
> > - AV_TIME_BASE_Q,
> > - cat->avf->streams[pkt->stream_index]->time_base);
> > + if (cat->avf->start_time == AV_NOPTS_VALUE)
> > + delta = av_rescale_q(cat->cur_file->start_time,
> > + AV_TIME_BASE_Q,
> > + cat->avf->streams[pkt->stream_index]->time_base);
> > + else
> > + delta = av_rescale_q(cat->cur_file->start_time - cat->avf->start_time,
> > + AV_TIME_BASE_Q,
> > + cat->avf->streams[pkt->stream_index]->time_base);
> > if (pkt->pts != AV_NOPTS_VALUE)
> > pkt->pts += delta;
> > if (pkt->dts != AV_NOPTS_VALUE)
>
> I am ok in principle, but I like it better written like [PATCH 1/2]: less
> code duplication, less changed lines.
applied
>
> Also, I wonder if there is any disadvantage in [PATCH 2/2], which would fix
> this particular problem too.
dunno
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141215/f7058d53/attachment.asc>
More information about the ffmpeg-devel
mailing list