Browse code

ffmpeg: use options for abuffersink.

Also remove unused buffersink_params.

Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Nicolas George authored on 2013/04/11 21:58:08
Showing 1 changed files
... ...
@@ -285,13 +285,11 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter,
285 285
     int pad_idx = out->pad_idx;
286 286
     int ret;
287 287
     char name[255];
288
-    AVBufferSinkParams *buffersink_params = av_buffersink_params_alloc();
289 288
 
290 289
     snprintf(name, sizeof(name), "output stream %d:%d", ost->file_index, ost->index);
291 290
     ret = avfilter_graph_create_filter(&ofilter->filter,
292 291
                                        avfilter_get_by_name("buffersink"),
293 292
                                        name, NULL, NULL, fg->graph);
294
-    av_freep(&buffersink_params);
295 293
 
296 294
     if (ret < 0)
297 295
         return ret;
... ...
@@ -368,18 +366,15 @@ static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter,
368 368
     char *sample_fmts, *sample_rates, *channel_layouts;
369 369
     char name[255];
370 370
     int ret;
371
-    AVABufferSinkParams *params = av_abuffersink_params_alloc();
372 371
 
373
-    if (!params)
374
-        return AVERROR(ENOMEM);
375
-    params->all_channel_counts = 1;
376 372
     snprintf(name, sizeof(name), "output stream %d:%d", ost->file_index, ost->index);
377 373
     ret = avfilter_graph_create_filter(&ofilter->filter,
378 374
                                        avfilter_get_by_name("abuffersink"),
379
-                                       name, NULL, params, fg->graph);
380
-    av_freep(&params);
375
+                                       name, NULL, NULL, fg->graph);
381 376
     if (ret < 0)
382 377
         return ret;
378
+    if ((ret = av_opt_set_int(ofilter->filter, "all_channel_counts", 1, AV_OPT_SEARCH_CHILDREN)) < 0)
379
+        return ret;
383 380
 
384 381
 #define AUTO_INSERT_FILTER(opt_name, filter_name, arg) do {                 \
385 382
     AVFilterContext *filt_ctx;                                              \