[FFmpeg-cvslog] lavfi/select: fix compilation with avcodec disabled.

Clément Bœsch git at videolan.org
Thu Dec 20 05:17:48 CET 2012


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Thu Dec 20 05:17:17 2012 +0100| [174c483e2e751c71ca9ae4e9ca33082bbb1eea56] | committer: Clément Bœsch

lavfi/select: fix compilation with avcodec disabled.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=174c483e2e751c71ca9ae4e9ca33082bbb1eea56
---

 libavfilter/f_select.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
index 11ee988..4881a85 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)



More information about the ffmpeg-cvslog mailing list