]> git.sesse.net Git - ffmpeg/commitdiff
avfiltergraph: add aresample_swr_opts
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 23 Nov 2012 14:33:47 +0000 (15:33 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 26 Nov 2012 02:51:08 +0000 (03:51 +0100)
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/avfiltergraph.c
libavfilter/avfiltergraph.h

index ca290235c5b935ddcd323233019b71e653207be7..52af2adbfc76f2b7e8dd0c8856804c05f742817c 100644 (file)
@@ -37,6 +37,7 @@
 
 static const AVOption options[]={
 {"scale_sws_opts"       , "default scale filter options"        , OFFSET(scale_sws_opts)        ,  AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, 0 },
+{"aresample_swr_opts"   , "default aresample filter options"    , OFFSET(aresample_swr_opts)    ,  AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, 0 },
 {0}
 };
 
@@ -66,6 +67,7 @@ void avfilter_graph_free(AVFilterGraph **graph)
         avfilter_free((*graph)->filters[(*graph)->filter_count - 1]);
     av_freep(&(*graph)->sink_links);
     av_freep(&(*graph)->scale_sws_opts);
+    av_freep(&(*graph)->aresample_swr_opts);
     av_freep(&(*graph)->filters);
     av_freep(graph);
 }
@@ -386,7 +388,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
                     snprintf(inst_name, sizeof(inst_name), "auto-inserted resampler %d",
                              resampler_count++);
                     if ((ret = avfilter_graph_create_filter(&convert, filter,
-                                                            inst_name, NULL, NULL, graph)) < 0)
+                                                            inst_name, graph->aresample_swr_opts, NULL, graph)) < 0)
                         return ret;
                     break;
                 default:
index 05181245823da3e5be24ea8e9ec8b436d1697b1d..728bbb5c15b7ed6a6ba712d5b97caecc43924dea 100644 (file)
@@ -32,6 +32,8 @@ typedef struct AVFilterGraph {
 
     char *scale_sws_opts; ///< sws options to use for the auto-inserted scale filters
 
+    char *aresample_swr_opts; ///< swr options to use for the auto-inserted aresample filters, Access ONLY through AVOptions
+
     /**
      * Private fields
      *