Gentoo Archives: gentoo-commits

From: "Alexis Ballier (aballier)" <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-sound/squeezeslave/files: squeezeslave-1.1_p381-ffmpeg2.patch
Date: Fri, 06 Feb 2015 14:24:56
Message-Id: 20150206142450.5214B112F1@oystercatcher.gentoo.org
1 aballier 15/02/06 14:24:50
2
3 Added: squeezeslave-1.1_p381-ffmpeg2.patch
4 Log:
5 fix build with ffmpeg2, patch by Rick Moritz in bug #481062 with some extra changes by me for ffmpeg 2.4+
6
7 Signed-off-by: aballier@g.o
8 (Portage version: 2.2.15/cvs/Linux x86_64, signed Manifest commit with key 160F534A)
9
10 Revision Changes Path
11 1.1 media-sound/squeezeslave/files/squeezeslave-1.1_p381-ffmpeg2.patch
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/squeezeslave/files/squeezeslave-1.1_p381-ffmpeg2.patch?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/squeezeslave/files/squeezeslave-1.1_p381-ffmpeg2.patch?rev=1.1&content-type=text/plain
15
16 Index: squeezeslave-1.1_p381-ffmpeg2.patch
17 ===================================================================
18 Index: squeezeslave-1.1_p381/src/slimaudio/slimaudio_decoder.c
19 ===================================================================
20 --- squeezeslave-1.1_p381.orig/src/slimaudio/slimaudio_decoder.c
21 +++ squeezeslave-1.1_p381/src/slimaudio/slimaudio_decoder.c
22 @@ -69,7 +69,6 @@ void av_lib_setup (void)
23 av_register_all();
24 DEBUGF("decoder_thread: av_register_all\n");
25
26 - avcodec_init();
27 avcodec_register_all();
28 DEBUGF("decoder_thread: avcodec_register_all\n");
29
30 Index: squeezeslave-1.1_p381/src/slimaudio/slimaudio_decoder_aac.c
31 ===================================================================
32 --- squeezeslave-1.1_p381.orig/src/slimaudio/slimaudio_decoder_aac.c
33 +++ squeezeslave-1.1_p381/src/slimaudio/slimaudio_decoder_aac.c
34 @@ -47,6 +47,11 @@
35
36 #define AUDIO_INBUF_SIZE (AUDIO_CHUNK_SIZE*2)
37
38 +#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
39 +#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
40 +#endif
41 +
42 +
43 int slimaudio_decoder_aac_init(slimaudio_t *audio)
44 {
45 av_lib_setup();
46 @@ -164,7 +169,7 @@ int slimaudio_decoder_aac_process(slimau
47 }
48 else
49 {
50 - AVIOCtx->is_streamed = 1;
51 + AVIOCtx->seekable = 0;
52 }
53
54 AVInputFormat* pAVInputFormat = av_find_input_format(streamformat);
55 @@ -199,7 +204,7 @@ int slimaudio_decoder_aac_process(slimau
56 }
57 else
58 {
59 - iRC = av_find_stream_info(pFormatCtx);
60 + iRC = avformat_find_stream_info(pFormatCtx, NULL);
61 if ( iRC < 0 )
62 {
63 DEBUGF("aac: find stream info failed:%d\n", iRC);
64 @@ -236,7 +241,7 @@ int slimaudio_decoder_aac_process(slimau
65 }
66
67 /* Open codec */
68 - iRC = avcodec_open(pCodecCtx, pCodec);
69 + iRC = avcodec_open2(pCodecCtx, pCodec, NULL);
70 if ( iRC < 0)
71 {
72 DEBUGF("aac: could not open codec:%d\n", iRC);
73 @@ -274,7 +279,7 @@ int slimaudio_decoder_aac_process(slimau
74 eos=true;
75 }
76
77 - if ( url_ferror(pFormatCtx->pb) )
78 + if ( pFormatCtx->pb && pFormatCtx->pb->error )
79 {
80 DEBUGF("aac: url_ferror\n");
81 #if 0
82 @@ -312,7 +317,7 @@ int slimaudio_decoder_aac_process(slimau
83
84 /* Close the stream */
85 DEBUGF ("aac: av_close_input_stream\n");
86 - av_close_input_stream(pFormatCtx);
87 + avformat_close_input(&pFormatCtx);
88
89 return 0;
90 }
91 Index: squeezeslave-1.1_p381/src/slimaudio/slimaudio_decoder_wma.c
92 ===================================================================
93 --- squeezeslave-1.1_p381.orig/src/slimaudio/slimaudio_decoder_wma.c
94 +++ squeezeslave-1.1_p381/src/slimaudio/slimaudio_decoder_wma.c
95 @@ -47,6 +47,10 @@
96
97 #define AUDIO_INBUF_SIZE (AUDIO_CHUNK_SIZE*2)
98
99 +#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
100 +#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
101 +#endif
102 +
103 int slimaudio_decoder_wma_init(slimaudio_t *audio)
104 {
105 av_lib_setup();
106 @@ -159,7 +163,7 @@ int slimaudio_decoder_wma_process(slimau
107 }
108 else
109 {
110 - AVIOCtx->is_streamed = 1;
111 + AVIOCtx->seekable = 1;
112 }
113
114 AVInputFormat* pAVInputFormat = av_find_input_format(streamformat);
115 @@ -194,7 +198,7 @@ int slimaudio_decoder_wma_process(slimau
116 }
117 else
118 {
119 - iRC = av_find_stream_info(pFormatCtx);
120 + iRC = avformat_find_stream_info(pFormatCtx,NULL);
121 if ( iRC < 0 )
122 {
123 DEBUGF("wma: find stream info failed:%d\n", iRC);
124 @@ -231,7 +235,7 @@ int slimaudio_decoder_wma_process(slimau
125 }
126
127 /* Open codec */
128 - iRC = avcodec_open(pCodecCtx, pCodec);
129 + iRC = avcodec_open2(pCodecCtx, pCodec, NULL);
130 if ( iRC < 0)
131 {
132 DEBUGF("wma: could not open codec:%d\n", iRC);
133 @@ -270,7 +274,7 @@ int slimaudio_decoder_wma_process(slimau
134 eos=true;
135 }
136
137 - if ( url_ferror(pFormatCtx->pb) )
138 + if ( pFormatCtx->pb && pFormatCtx->pb->error )
139 {
140 DEBUGF("wma: url_ferror\n");
141 #if 0
142 @@ -308,7 +312,7 @@ int slimaudio_decoder_wma_process(slimau
143
144 /* Close the stream */
145 DEBUGF ("wma: av_close_input_stream\n");
146 - av_close_input_stream(pFormatCtx);
147 + avformat_close_input(&pFormatCtx);
148
149 return 0;
150 }