# HG changeset patch # User conrad # Date 1259164814 0 # Node ID aacf5f712ba7ef35887cb249dad8ace18ce6a769 # Parent d4ca61e293a3655dae7047e14508ad9f7bae6b2b Support compiling against libtheora older than 1.1 diff -r d4ca61e293a3 -r aacf5f712ba7 libtheoraenc.c --- a/libtheoraenc.c Tue Nov 24 16:58:50 2009 +0000 +++ b/libtheoraenc.c Wed Nov 25 16:00:14 2009 +0000 @@ -86,6 +86,7 @@ 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 @@ 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 @@ 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)