Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
... | ... |
@@ -37,6 +37,7 @@ |
37 | 37 |
|
38 | 38 |
static const AVOption options[]={ |
39 | 39 |
{"scale_sws_opts" , "default scale filter options" , OFFSET(scale_sws_opts) , AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, 0 }, |
40 |
+{"aresample_swr_opts" , "default aresample filter options" , OFFSET(aresample_swr_opts) , AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, 0 }, |
|
40 | 41 |
{0} |
41 | 42 |
}; |
42 | 43 |
|
... | ... |
@@ -66,6 +67,7 @@ void avfilter_graph_free(AVFilterGraph **graph) |
66 | 66 |
avfilter_free((*graph)->filters[(*graph)->filter_count - 1]); |
67 | 67 |
av_freep(&(*graph)->sink_links); |
68 | 68 |
av_freep(&(*graph)->scale_sws_opts); |
69 |
+ av_freep(&(*graph)->aresample_swr_opts); |
|
69 | 70 |
av_freep(&(*graph)->filters); |
70 | 71 |
av_freep(graph); |
71 | 72 |
} |
... | ... |
@@ -386,7 +388,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) |
386 | 386 |
snprintf(inst_name, sizeof(inst_name), "auto-inserted resampler %d", |
387 | 387 |
resampler_count++); |
388 | 388 |
if ((ret = avfilter_graph_create_filter(&convert, filter, |
389 |
- inst_name, NULL, NULL, graph)) < 0) |
|
389 |
+ inst_name, graph->aresample_swr_opts, NULL, graph)) < 0) |
|
390 | 390 |
return ret; |
391 | 391 |
break; |
392 | 392 |
default: |
... | ... |
@@ -32,6 +32,8 @@ typedef struct AVFilterGraph { |
32 | 32 |
|
33 | 33 |
char *scale_sws_opts; ///< sws options to use for the auto-inserted scale filters |
34 | 34 |
|
35 |
+ char *aresample_swr_opts; ///< swr options to use for the auto-inserted aresample filters, Access ONLY through AVOptions |
|
36 |
+ |
|
35 | 37 |
/** |
36 | 38 |
* Private fields |
37 | 39 |
* |