aboutsummaryrefslogtreecommitdiff
path: root/src/conversation/gnunet-helper-audio-playback.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/conversation/gnunet-helper-audio-playback.c')
-rw-r--r--src/conversation/gnunet-helper-audio-playback.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/conversation/gnunet-helper-audio-playback.c b/src/conversation/gnunet-helper-audio-playback.c
index 7b9589181..77529e3b5 100644
--- a/src/conversation/gnunet-helper-audio-playback.c
+++ b/src/conversation/gnunet-helper-audio-playback.c
@@ -173,15 +173,15 @@ process_header (ogg_packet *op)
173 dec = opus_decoder_create (SAMPLING_RATE, channels, &err); 173 dec = opus_decoder_create (SAMPLING_RATE, channels, &err);
174 if (OPUS_OK != err) 174 if (OPUS_OK != err)
175 { 175 {
176 fprintf (stderr, 176 fprintf (stderr,
177 "Cannot create encoder: %s\n", 177 "Cannot create encoder: %s\n",
178 opus_strerror (err)); 178 opus_strerror (err));
179 return NULL; 179 return NULL;
180 } 180 }
181 if (! dec) 181 if (! dec)
182 { 182 {
183 fprintf (stderr, 183 fprintf (stderr,
184 "Decoder initialization failed: %s\n", 184 "Decoder initialization failed: %s\n",
185 opus_strerror (err)); 185 opus_strerror (err));
186 return NULL; 186 return NULL;
187 } 187 }
@@ -209,7 +209,7 @@ process_header (ogg_packet *op)
209 209
210 210
211#ifdef DEBUG_DUMP_DECODED_OGG 211#ifdef DEBUG_DUMP_DECODED_OGG
212static size_t 212static size_t
213fwrite_le32(opus_int32 i32, FILE *file) 213fwrite_le32(opus_int32 i32, FILE *file)
214{ 214{
215 unsigned char buf[4]; 215 unsigned char buf[4];
@@ -221,7 +221,7 @@ fwrite_le32(opus_int32 i32, FILE *file)
221} 221}
222 222
223 223
224static size_t 224static size_t
225fwrite_le16(int i16, FILE *file) 225fwrite_le16(int i16, FILE *file)
226{ 226{
227 unsigned char buf[2]; 227 unsigned char buf[2];
@@ -292,9 +292,11 @@ audio_write (int64_t maxout)
292 int64_t wrote = 0; 292 int64_t wrote = 0;
293 wrote = to_write; 293 wrote = to_write;
294 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 294 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
295 "Writing %u * %u * %u = %u bytes into PA\n", 295 "Writing %u * %u * %u = %llu bytes into PA\n",
296 to_write, channels, sizeof (float), 296 to_write,
297 to_write * channels * sizeof (float)); 297 channels,
298 (unsigned int) sizeof (float),
299 (unsigned long long) (to_write * channels * sizeof (float)));
298#ifdef DEBUG_DUMP_DECODED_OGG 300#ifdef DEBUG_DUMP_DECODED_OGG
299 if (dump_to_stdout) 301 if (dump_to_stdout)
300 { 302 {
@@ -453,12 +455,14 @@ ogg_demux_and_decode ()
453 so that we can adjust the timestamp counting.*/ 455 so that we can adjust the timestamp counting.*/
454 gran_offset = preskip; 456 gran_offset = preskip;
455 457
456 if (!pcm_buffer) 458 if (! pcm_buffer)
457 { 459 {
458 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 460 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
459 "Allocating %u * %u * %u = %u bytes of buffer space\n", 461 "Allocating %u * %u * %u = %llu bytes of buffer space\n",
460 MAX_FRAME_SIZE, channels, sizeof (float), 462 MAX_FRAME_SIZE,
461 MAX_FRAME_SIZE * channels * sizeof (float)); 463 channels,
464 (unsigned int) sizeof (float),
465 (unsigned long long) (MAX_FRAME_SIZE * channels * sizeof (float)));
462 pcm_buffer = pa_xmalloc (sizeof (float) * MAX_FRAME_SIZE * channels); 466 pcm_buffer = pa_xmalloc (sizeof (float) * MAX_FRAME_SIZE * channels);
463 } 467 }
464 } 468 }
@@ -501,7 +505,9 @@ ogg_demux_and_decode ()
501 frame_size = ret; 505 frame_size = ret;
502 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 506 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
503 "Decoded %d bytes/channel (%d bytes) from %u compressed bytes\n", 507 "Decoded %d bytes/channel (%d bytes) from %u compressed bytes\n",
504 ret, ret * channels, op.bytes); 508 ret,
509 ret * channels,
510 (unsigned int) op.bytes);
505 511
506 /*Apply header gain, if we're not using an opus library new 512 /*Apply header gain, if we're not using an opus library new
507 enough to do this internally.*/ 513 enough to do this internally.*/