shithub: aubio

Download patch

ref: 1fe3ac2711adcbe1339a80ecaae5045082df3256
parent: 3d5cddf69a0d8e98a4b44b2ccb62ed21113f0796
author: Paul Brossier <piem@piem.org>
date: Thu Dec 5 18:23:08 EST 2013

src/io/source_avcodec.c: wrap lines, remove old comments

--- a/src/io/source_avcodec.c
+++ b/src/io/source_avcodec.c
@@ -100,17 +100,19 @@
     uint8_t errorstr_len = 128;
     char errorstr[errorstr_len];
     if (av_strerror (err, errorstr, errorstr_len) == 0) {
-      AUBIO_ERR("Could not find stream information for %s (%s)\n", s->path, errorstr);
+      AUBIO_ERR("Could not find stream information "
+          "for %s (%s)\n", s->path, errorstr);
     } else {
-      AUBIO_ERR("Could not find stream information for %s (unknown error)\n", s->path);
+      AUBIO_ERR("Could not find stream information "
+          "for %s (unknown error)\n", s->path);
     }
     goto beach;
   }
 
-  // Dump information about file onto standard error
+  // dump information about file onto standard error
   //av_dump_format(avFormatCtx, 0, s->path, 0);
 
-  // look for the first audio stream, printing a warning if more than one is found
+  // look for the first audio stream
   uint_t i;
   sint_t selected_stream = -1;
   for (i = 0; i < avFormatCtx->nb_streams; i++) {
@@ -118,7 +120,8 @@
       if (selected_stream == -1) {
         selected_stream = i;
       } else {
-        AUBIO_WRN("More than one audio stream in %s, taking the first one\n", s->path);
+        AUBIO_WRN("More than one audio stream in %s, "
+            "taking the first one\n", s->path);
       }
     }
   }
@@ -175,9 +178,11 @@
     uint8_t errorstr_len = 128;
     char errorstr[errorstr_len];
     if (av_strerror (err, errorstr, errorstr_len) == 0) {
-      AUBIO_ERR("Could not open AVAudioResampleContext for %s (%s)\n", s->path, errorstr);
+      AUBIO_ERR("Could not open AVAudioResampleContext for %s (%s)\n",
+          s->path, errorstr);
     } else {
-      AUBIO_ERR("Could not open AVAudioResampleContext for %s (unknown error)\n", s->path);
+      AUBIO_ERR("Could not open AVAudioResampleContext for %s (unknown error)\n",
+          s->path);
     }
     goto beach;
   }
@@ -279,10 +284,6 @@
   //AUBIO_WRN("max_out_samples is %d for AUBIO_AVCODEC_MIN_BUFFER_SIZE %d\n",
   //    max_out_samples, AUBIO_AVCODEC_MIN_BUFFER_SIZE);
 
-  //AUBIO_WRN("aubio_source_avcodec_readframe converted %d to %d samples\n", in_samples, out_samples);
-  //for (i = 0; i < out_samples; i ++) {
-  //  AUBIO_DBG("%f\n", SHORT_TO_FLOAT(output[i]));
-  //}
   av_free_packet(&avPacket);
   s->avFormatCtx = avFormatCtx;
   s->avCodecCtx = avCodecCtx;
@@ -292,7 +293,6 @@
 
   *read_samples = out_samples;
 }
-
 
 void aubio_source_avcodec_do(aubio_source_avcodec_t * s, fvec_t * read_data, uint_t * read){
   uint_t i;
--