summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorClément Bœsch <clement.boesch@smartjog.com>2011-12-28 10:09:45 +0100
committerClément Bœsch <ubitux@gmail.com>2012-01-02 15:33:56 +0100
commit940d3cc0b0762f8beb8a12542e7553c17032ed3d (patch)
treed58a2c3010d3b36aa84feb540296a0f93ad5be11 /libavfilter
parente2c1d3ec4128629d2f668243d37102506c9bd389 (diff)
drawtext: fix hard dependency to lavc (timecode).
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_drawtext.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 9f8558657e..0de5b9f820 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -29,6 +29,7 @@
#include <sys/time.h>
#include <time.h>
+#include "config.h"
#include "libavcodec/timecode.h"
#include "libavutil/avstring.h"
#include "libavutil/colorspace.h"
@@ -341,10 +342,16 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
}
if (dtext->tc.str) {
+#if CONFIG_AVCODEC
if (avpriv_init_smpte_timecode(ctx, &dtext->tc) < 0)
return AVERROR(EINVAL);
if (!dtext->text)
dtext->text = av_strdup("");
+#else
+ av_log(ctx, AV_LOG_ERROR,
+ "Timecode options are only available if libavfilter is built with libavcodec enabled.\n");
+ return AVERROR(EINVAL);
+#endif
}
if (!dtext->text) {
@@ -722,11 +729,13 @@ static int draw_text(AVFilterContext *ctx, AVFilterBufferRef *picref,
buf_size *= 2;
} while ((buf = av_realloc(buf, buf_size)));
+#if CONFIG_AVCODEC
if (dtext->tc.str) {
char tcbuf[sizeof("hh:mm:ss.ff")];
avpriv_timecode_to_string(tcbuf, &dtext->tc, dtext->frame_id++);
buf = av_asprintf("%s%s", dtext->text, tcbuf);
}
+#endif
if (!buf)
return AVERROR(ENOMEM);