summaryrefslogtreecommitdiff
path: root/audio/sox/files/patch-libav9
blob: ed3aaac894a1be58005dff23deb82241808271e6 (plain) (blame)
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
diff -burN src/ffmpeg.c sox-14.4.0/src/ffmpeg.c
--- src/ffmpeg.c.orig	2012-11-25 21:59:45.990825656 +0100
+++ src/ffmpeg.c	2012-11-25 22:07:06.436809624 +0100
@@ -98,7 +98,7 @@
   ic->error_recognition = 1;
 #endif
 
-  if (!codec || avcodec_open(enc, codec) < 0)
+  if (!codec || avcodec_open2(enc, codec, NULL) < 0)
     return -1;
   if (enc->codec_type != AVMEDIA_TYPE_AUDIO) {
     lsx_fail("ffmpeg CODEC %x is not an audio CODEC", enc->codec_type);
@@ -180,7 +180,7 @@
   }
 
   /* Get CODEC parameters */
-  if ((ret = av_find_stream_info(ffmpeg->ctxt)) < 0) {
+  if ((ret = avformat_find_stream_info(ffmpeg->ctxt, NULL)) < 0) {
     lsx_fail("ffmpeg could not find CODEC parameters for %s", ft->filename);
     return SOX_EOF;
   }
@@ -274,7 +274,7 @@
   AVCodecContext *c;
   AVStream *st;
 
-  st = av_new_stream(oc, 1);
+  st = avformat_new_stream(oc, NULL);
   if (!st) {
     lsx_fail("ffmpeg could not alloc stream");
     return NULL;
@@ -308,7 +308,7 @@
   }
 
   /* open it */
-  if (avcodec_open(c, codec) < 0) {
+  if (avcodec_open2(c, codec, NULL) < 0) {
     lsx_fail("ffmpeg could not open CODEC");
     return SOX_EOF;
   }