On Thu, 2015-10-29 at 19:52 +0100, Anton Khirnov wrote:
> Quoting John Stebbins (2015-10-28 17:48:34)
> > From: Stefano Sabatini <[email protected]>
> > 
> > (cherry picked from ffmpeg commit
> > 7cd5fa35fecc2717223459d04822faed6bbd40fa)
> > ---
> >  libavfilter/vsrc_testsrc.c | 15 +++++++--------
> >  1 file changed, 7 insertions(+), 8 deletions(-)
> > 
> > diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c
> > index e41625e..cb13d7e 100644
> > --- a/libavfilter/vsrc_testsrc.c
> > +++ b/libavfilter/vsrc_testsrc.c
> > @@ -46,7 +46,7 @@ typedef struct TestSourceContext {
> >      const AVClass *class;
> >      int h, w;
> >      unsigned int nb_frame;
> > -    AVRational time_base;
> > +    AVRational time_base, frame_rate;
> >      int64_t pts, max_pts;
> >      char *size;                 ///< video frame size
> >      char *rate;                 ///< video frame rate
> > @@ -75,7 +75,6 @@ static const AVOption testsrc_options[] = {
> >  static av_cold int init_common(AVFilterContext *ctx)
> >  {
> >      TestSourceContext *test = ctx->priv;
> > -    AVRational frame_rate_q;
> >      int64_t duration = -1;
> >      int ret = 0;
> >  
> > @@ -84,8 +83,8 @@ static av_cold int init_common(AVFilterContext
> > *ctx)
> >          return ret;
> >      }
> >  
> > -    if ((ret = av_parse_video_rate(&frame_rate_q, test->rate)) < 0
> > ||
> > -        frame_rate_q.den <= 0 || frame_rate_q.num <= 0) {
> > +    if ((ret = av_parse_video_rate(&test->frame_rate, test->rate))
> > < 0 ||
> > +        test->frame_rate.den <= 0 || test->frame_rate.num <= 0) {
> 
> This looks unnecessary, av_parse_video_rate() already checks that the
> value is a valid framerate.
> 

Ok.  I was just making it consistent with the code it replaces.  I will
eliminate the redundant test.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to