summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorDavid Conrad <lessen42@gmail.com>2009-11-25 16:00:14 +0000
committerDavid Conrad <lessen42@gmail.com>2009-11-25 16:00:14 +0000
commit800841fd0c6c686c62bdd482e46b6c61b72fa531 (patch)
tree76c7d6c2b8d4f0c13fe4131595b4767043445377 /libavcodec
parentb5a683eb112cbddcc71f41561edc4616dc553ace (diff)
downloadffmpeg-800841fd0c6c686c62bdd482e46b6c61b72fa531.tar.gz
Support compiling against libtheora older than 1.1
Originally committed as revision 20609 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/libtheoraenc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c
index b87e86f63c..fd4a9ec415 100644
--- a/libavcodec/libtheoraenc.c
+++ b/libavcodec/libtheoraenc.c
@@ -86,6 +86,7 @@ static int concatenate_packet(unsigned int* offset,
static int get_stats(AVCodecContext *avctx, int eos)
{
+#ifdef TH_ENCCTL_2PASS_OUT
TheoraContext *h = avctx->priv_data;
uint8_t *buf;
int bytes;
@@ -108,12 +109,17 @@ static int get_stats(AVCodecContext *avctx, int eos)
av_base64_encode(avctx->stats_out, b64_size, h->stats, h->stats_offset);
}
return 0;
+#else
+ av_log(avctx, AV_LOG_ERROR, "libtheora too old to support 2pass\n");
+ return -1;
+#endif
}
// libtheora won't read the entire buffer we give it at once, so we have to
// repeatedly submit it...
static int submit_stats(AVCodecContext *avctx)
{
+#ifdef TH_ENCCTL_2PASS_IN
TheoraContext *h = avctx->priv_data;
int bytes;
if (!h->stats) {
@@ -138,6 +144,10 @@ static int submit_stats(AVCodecContext *avctx)
h->stats_offset += bytes;
}
return 0;
+#else
+ av_log(avctx, AV_LOG_ERROR, "libtheora too old to support 2pass\n");
+ return -1;
+#endif
}
static av_cold int encode_init(AVCodecContext* avc_context)