summaryrefslogtreecommitdiff
blob: be1180b24966eef50da6054a90635d236dea5eb9 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Index: moc-2.5.0-alpha3/configure.in
===================================================================
--- moc-2.5.0-alpha3.orig/configure.in
+++ moc-2.5.0-alpha3/configure.in
@@ -485,6 +485,7 @@ then
 				  DECODER_PLUGINS="$DECODER_PLUGINS ffmpeg"],
 				  [true])
 	fi
+	AC_CHECK_HEADERS(ffmpeg/avformat.h libavformat/avformat.h)
 fi
 
 dnl speex
Index: moc-2.5.0-alpha3/decoder_plugins/ffmpeg/ffmpeg.c
===================================================================
--- moc-2.5.0-alpha3.orig/decoder_plugins/ffmpeg/ffmpeg.c
+++ moc-2.5.0-alpha3/decoder_plugins/ffmpeg/ffmpeg.c
@@ -22,7 +22,11 @@
 #ifdef HAVE_INTTYPES_H
 # include <inttypes.h>
 #endif
+#if HAVE_LIBAVFORMAT_AVFORMAT_H
+#include <libavformat/avformat.h>
+#else
 #include <ffmpeg/avformat.h>
+#endif
 
 /* FFmpeg also likes common names, without that, our common.h and log.h would
  * not be included. */
Index: moc-2.5.0-alpha3/decoder_plugins/ffmpeg/ffmpeg.c
===================================================================
--- moc-2.5.0-alpha3.orig/decoder_plugins/ffmpeg/ffmpeg.c
+++ moc-2.5.0-alpha3/decoder_plugins/ffmpeg/ffmpeg.c
@@ -228,12 +228,12 @@
 {
 	struct ffmpeg_data *data = (struct ffmpeg_data *)prv_data;
 	int ret;
-	int data_size;
 	char avbuf[AVCODEC_MAX_AUDIO_FRAME_SIZE * sizeof(int16_t)];
 	AVPacket pkt;
 	uint8_t *pkt_data;
 	int pkt_size = 0;
 	int filled = 0;
+	int data_size = sizeof(avbuf);
 
 	decoder_error_clear (&data->error);
 
@@ -276,7 +276,7 @@
 		while (pkt_size) {
 			int len;
 		
-			len = avcodec_decode_audio (data->enc, (int16_t *)avbuf,
+			len = avcodec_decode_audio2 (data->enc, (int16_t *)avbuf,
 					&data_size, pkt_data, pkt_size);
 			debug ("Decoded %dB", data_size);