summaryrefslogtreecommitdiff
blob: baec435eba9fa6f88c21fca70305bacd6ca9b030 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--- libavcodec/libtheoraenc.c.orig	2009-11-25 20:55:18.000000000 -0700
+++ libavcodec/libtheoraenc.c	2009-11-25 20:55:21.000000000 -0700
@@ -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)