[FFmpeg-trac] #5618(avutil:new): Inconsistent behaviour between av_opt_set, av_opt_set_q and av_opt_set_video_rate

FFmpeg trac at avcodec.org
Tue Jun 7 19:58:19 CEST 2016


#5618: Inconsistent behaviour between av_opt_set, av_opt_set_q and
av_opt_set_video_rate
--------------------------------+--------------------------------------
             Reporter:  mfcc64  |                     Type:  defect
               Status:  new     |                 Priority:  normal
            Component:  avutil  |                  Version:  git-master
             Keywords:          |               Blocked By:
             Blocking:          |  Reproduced by developer:  0
Analyzed by developer:  0       |
--------------------------------+--------------------------------------
 Summary of the bug:
 How to reproduce:
 {{{
 #include <libavutil/opt.h>
 #include <libavutil/log.h>
 #include <libavfilter/avfilter.h>

 int main(int argc, char **argv)
 {
     AVFilterGraph *graph;
     AVFilterContext *showcqt;

     avfilter_register_all();
     graph = avfilter_graph_alloc();
     showcqt = avfilter_graph_alloc_filter(graph,
 avfilter_get_by_name("showcqt"), "showcqt");
     if (av_opt_set(showcqt, "fps", "25", AV_OPT_SEARCH_CHILDREN) < 0)
         av_log(NULL, AV_LOG_ERROR, "error calling av_opt_set()\n");
     if (av_opt_set_q(showcqt, "fps", av_make_q(25,1),
 AV_OPT_SEARCH_CHILDREN) < 0)
         av_log(NULL, AV_LOG_ERROR, "error calling av_opt_set_q()\n");
     if (av_opt_set_video_rate(showcqt, "fps", av_make_q(25,1),
 AV_OPT_SEARCH_CHILDREN) < 0)
         av_log(NULL, AV_LOG_ERROR, "error calling
 av_opt_set_video_rate()\n");
     return 0;
 }
 }}}

 av_opt_set_q and av_opt_set_video rate do range checking
 but av_opt_set doesn't.
 Here is the result:
 {{{
 showcqt @ 0x76b600] Value 25.000000 for parameter 'fps' out of range [0 -
 0]
 error calling av_opt_set_q()
 [showcqt @ 0x76b600] Value 25.000000 for parameter 'fps' out of range [0 -
 0]
 error calling av_opt_set_video_rate()
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/5618>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list