History

lavfi/silencedetect: switch to an AVOptions-based system.

Clément Bœsch committed 13 years ago

Commit 1b1688b1 parent 7c11c213 files · +3 −17Browse files

Showing the changes to libavfilter (2 of 3 files). Show all

Unified · Split

2 files
  1. libavfilter/af_silencedetect.c +0 −17
  2. libavfilter/avfilter.c +1 −0
libavfilter/af_silencedetect.c+0−17
@@ -54,22 +54,6 @@ static const AVOption silencedetect_options[] = { · 53 unmodified lines
5454
5555 AVFILTER_DEFINE_CLASS(silencedetect);
5656
57−static av_cold int init(AVFilterContext *ctx, const char *args)
58−{
59− int ret;
60− SilenceDetectContext *silence = ctx->priv;
61−
62− silence->class = &silencedetect_class;
63− av_opt_set_defaults(silence);
64−
65− if ((ret = av_set_options_string(silence, args, "=", ":")) < 0)
66− return ret;
67−
68− av_opt_free(silence);
69−
70− return 0;
71−}
72−
7357 static char *get_metadata_val(AVFrame *insamples, const char *key)
7458 {
7559 AVDictionaryEntry *e = av_dict_get(insamples->metadata, key, NULL, 0);
@@ -176,7 +160,6 @@ AVFilter avfilter_af_silencedetect = { · 100 unmodified lines
176160 .name = "silencedetect",
177161 .description = NULL_IF_CONFIG_SMALL("Detect silence."),
178162 .priv_size = sizeof(SilenceDetectContext),
179− .init = init,
180163 .query_formats = query_formats,
181164 .inputs = silencedetect_inputs,
182165 .outputs = silencedetect_outputs,
libavfilter/avfilter.c+1−0
@@ -681,6 +681,7 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque · 680 unmodified lines
681681 !strcmp(filter->filter->name, "format") ||
682682 !strcmp(filter->filter->name, "noformat") ||
683683 !strcmp(filter->filter->name, "resample") ||
684+ !strcmp(filter->filter->name, "silencedetect") ||
684685 !strcmp(filter->filter->name, "thumbnail") ||
685686 // !strcmp(filter->filter->name, "scale" ) ||
686687 0

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t