diff options
author | Clément Bœsch <ubitux@gmail.com> | 2012-12-20 05:17:17 +0100 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2012-12-20 05:17:36 +0100 |
commit | 174c483e2e751c71ca9ae4e9ca33082bbb1eea56 (patch) | |
tree | 10b212f2ed9ac7d0b2666b637ac575221cc45447 | |
parent | 974ac57e83f32f6876096ae20cb73000ff555753 (diff) | |
download | ffmpeg-174c483e2e751c71ca9ae4e9ca33082bbb1eea56.tar.gz |
lavfi/select: fix compilation with avcodec disabled.
-rw-r--r-- | libavfilter/f_select.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c index 11ee98839f..4881a85ece 100644 --- a/libavfilter/f_select.c +++ b/libavfilter/f_select.c @@ -206,12 +206,14 @@ static int config_input(AVFilterLink *inlink) select->var_values[VAR_SAMPLE_RATE] = inlink->type == AVMEDIA_TYPE_AUDIO ? inlink->sample_rate : NAN; - if (CONFIG_AVCODEC && select->do_scene_detect) { +#if CONFIG_AVCODEC + if (select->do_scene_detect) { select->avctx = avcodec_alloc_context3(NULL); if (!select->avctx) return AVERROR(ENOMEM); dsputil_init(&select->c, select->avctx); } +#endif return 0; } @@ -283,13 +285,15 @@ static int select_frame(AVFilterContext *ctx, AVFilterBufferRef *ref) !ref->video->interlaced ? INTERLACE_TYPE_P : ref->video->top_field_first ? INTERLACE_TYPE_T : INTERLACE_TYPE_B; select->var_values[VAR_PICT_TYPE] = ref->video->pict_type; - if (CONFIG_AVCODEC && select->do_scene_detect) { +#if CONFIG_AVCODEC + if (select->do_scene_detect) { char buf[32]; select->var_values[VAR_SCENE] = get_scene_score(ctx, ref); // TODO: document metadata snprintf(buf, sizeof(buf), "%f", select->var_values[VAR_SCENE]); av_dict_set(&ref->metadata, "lavfi.scene_score", buf, 0); } +#endif break; } @@ -370,6 +374,7 @@ static av_cold void uninit(AVFilterContext *ctx) select->expr = NULL; av_opt_free(select); +#if CONFIG_AVCODEC if (select->do_scene_detect) { avfilter_unref_bufferp(&select->prev_picref); if (select->avctx) { @@ -377,6 +382,7 @@ static av_cold void uninit(AVFilterContext *ctx) av_freep(&select->avctx); } } +#endif } static int query_formats(AVFilterContext *ctx) |