[FFmpeg-devel] [PATCH 2/3] libavcodec/v4l2_buffers: check for valid pts value

Lukas Rusak lorusak at gmail.com
Tue Jan 9 02:00:09 EET 2018


Hmm ok, disregard then.
On Mon, Jan 8, 2018 at 3:53 PM wm4 <nfxjfg at googlemail.com> wrote:

> On Mon,  8 Jan 2018 15:27:38 -0800
> Lukas Rusak <lorusak at gmail.com> wrote:
>
> > we check for a valid pts in v4l2_set_pts so we should do the same here
> >
> > ---
> >  libavcodec/v4l2_buffers.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c
> > index fdafe7edca..5337f6f287 100644
> > --- a/libavcodec/v4l2_buffers.c
> > +++ b/libavcodec/v4l2_buffers.c
> > @@ -71,7 +71,10 @@ static inline int64_t v4l2_get_pts(V4L2Buffer *avbuf)
> >      /* convert pts back to encoder timebase */
> >      v4l2_pts = avbuf->buf.timestamp.tv_sec * USEC_PER_SEC +
> avbuf->buf.timestamp.tv_usec;
> >
> > -    return av_rescale_q(v4l2_pts, v4l2_timebase, s->avctx->time_base);
> > +    if (v4l2_pts == 0)
> > +        return AV_NOPTS_VALUE;
> > +    else
> > +        return av_rescale_q(v4l2_pts, v4l2_timebase,
> s->avctx->time_base);
> >  }
> >
> >  static enum AVColorPrimaries v4l2_get_color_primaries(V4L2Buffer *buf)
>
> So, what about pts=0, which is valid? You shouldn't just turn 0 into
> AV_NOPTS_VALUE.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list