aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/conversation/gnunet-helper-audio-playback.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/src/conversation/gnunet-helper-audio-playback.c b/src/conversation/gnunet-helper-audio-playback.c
index 272eda576..a3d19652c 100644
--- a/src/conversation/gnunet-helper-audio-playback.c
+++ b/src/conversation/gnunet-helper-audio-playback.c
@@ -137,9 +137,11 @@ struct OpusHeadPacket
137 137
138GNUNET_NETWORK_STRUCT_END 138GNUNET_NETWORK_STRUCT_END
139 139
140/*Process an Opus header and setup the opus decoder based on it. 140/**
141 It takes several pointers for header values which are needed 141 * Process an Opus header and setup the opus decoder based on it.
142 elsewhere in the code.*/ 142 * It takes several pointers for header values which are needed
143 * elsewhere in the code.
144 */
143static OpusDecoder * 145static OpusDecoder *
144process_header (ogg_packet *op) 146process_header (ogg_packet *op)
145{ 147{
@@ -163,19 +165,24 @@ process_header (ogg_packet *op)
163 165
164 if (header.channel_mapping != 0) 166 if (header.channel_mapping != 0)
165 { 167 {
166 fprintf (stderr, "This implementation does not support non-mono streams\n"); 168 fprintf (stderr,
169 "This implementation does not support non-mono streams\n");
167 return NULL; 170 return NULL;
168 } 171 }
169 172
170 dec = opus_decoder_create (SAMPLING_RATE, channels, &err); 173 dec = opus_decoder_create (SAMPLING_RATE, channels, &err);
171 if (OPUS_OK != err) 174 if (OPUS_OK != err)
172 { 175 {
173 fprintf (stderr, "Cannot create encoder: %s\n", opus_strerror (err)); 176 fprintf (stderr,
177 "Cannot create encoder: %s\n",
178 opus_strerror (err));
174 return NULL; 179 return NULL;
175 } 180 }
176 if (!dec) 181 if (! dec)
177 { 182 {
178 fprintf (stderr, "Decoder initialization failed: %s\n", opus_strerror (err)); 183 fprintf (stderr,
184 "Decoder initialization failed: %s\n",
185 opus_strerror (err));
179 return NULL; 186 return NULL;
180 } 187 }
181 188
@@ -202,7 +209,8 @@ process_header (ogg_packet *op)
202 209
203 210
204#ifdef DEBUG_DUMP_DECODED_OGG 211#ifdef DEBUG_DUMP_DECODED_OGG
205static size_t fwrite_le32(opus_int32 i32, FILE *file) 212static size_t
213fwrite_le32(opus_int32 i32, FILE *file)
206{ 214{
207 unsigned char buf[4]; 215 unsigned char buf[4];
208 buf[0]=(unsigned char)(i32&0xFF); 216 buf[0]=(unsigned char)(i32&0xFF);
@@ -212,7 +220,9 @@ static size_t fwrite_le32(opus_int32 i32, FILE *file)
212 return fwrite(buf,4,1,file); 220 return fwrite(buf,4,1,file);
213} 221}
214 222
215static size_t fwrite_le16(int i16, FILE *file) 223
224static size_t
225fwrite_le16(int i16, FILE *file)
216{ 226{
217 unsigned char buf[2]; 227 unsigned char buf[2];
218 buf[0]=(unsigned char)(i16&0xFF); 228 buf[0]=(unsigned char)(i16&0xFF);
@@ -220,7 +230,9 @@ static size_t fwrite_le16(int i16, FILE *file)
220 return fwrite(buf,2,1,file); 230 return fwrite(buf,2,1,file);
221} 231}
222 232
223static int write_wav_header() 233
234static int
235write_wav_header()
224{ 236{
225 int ret; 237 int ret;
226 FILE *file = stdout; 238 FILE *file = stdout;
@@ -245,6 +257,7 @@ static int write_wav_header()
245 257
246#endif 258#endif
247 259
260
248static int64_t 261static int64_t
249audio_write (int64_t maxout) 262audio_write (int64_t maxout)
250{ 263{