]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Add a little diagnostic to the output of the alac decoder.
authorMike Brady <mikebrady@eircom.net>
Mon, 14 Dec 2015 17:12:03 +0000 (17:12 +0000)
committerMike Brady <mikebrady@eircom.net>
Mon, 14 Dec 2015 17:12:03 +0000 (17:12 +0000)
alac.c
player.c

diff --git a/alac.c b/alac.c
index 7259d4584ae0e288d6fea87317b94a7afb0af72b..d5833c61e0aaec45007c170731135dc600d3f668 100644 (file)
--- a/alac.c
+++ b/alac.c
@@ -810,7 +810,7 @@ void alac_decode_frame(alac_file *alac,
             }
             else
             {
-                fprintf(stderr, "FIXME: unhandled predicition type: %i\n", prediction_type);
+                fprintf(stderr, "FIXME: unhandled prediction type for compressed case: %i\n", prediction_type);
                 /* i think the only other prediction type (or perhaps this is just a
                  * boolean?) runs adaptive fir twice.. like:
                  * predictor_decompress_fir_adapt(predictor_error, tempout, ...)
@@ -1010,7 +1010,7 @@ void alac_decode_frame(alac_file *alac,
             }
             else
             { /* see mono case */
-                fprintf(stderr, "FIXME: unhandled predicition type: %i\n", prediction_type_a);
+                fprintf(stderr, "FIXME: unhandled prediction type on channel 1: %i\n", prediction_type_a);
             }
 
             /* channel 2 */
@@ -1035,7 +1035,7 @@ void alac_decode_frame(alac_file *alac,
             }
             else
             {
-                fprintf(stderr, "FIXME: unhandled predicition type: %i\n", prediction_type_b);
+                fprintf(stderr, "FIXME: unhandled prediction type on channel 2: %i\n", prediction_type_b);
             }
         }
         else
index de2a980f9ca2694fd0057f7a13367d32766614b1..3a8e754265d3facf8d5404c5ec1db1b265c7a2c1 100644 (file)
--- a/player.c
+++ b/player.c
@@ -242,7 +242,13 @@ static void alac_decode(short *dest, uint8_t *buf, int len) {
   } else {
     alac_decode_frame(decoder_info, buf, dest, &outsize);
   }
-
+  if (outsize!=FRAME_BYTES(frame_size)) {
+    if(outsize<FRAME_BYTES(frame_size)) {
+      debug(1,"Output from alac_decode is smaller than expected. Encrypted = %d.",encrypted);
+    } else {
+      debug(1,"OUtput from alac_decode larger than expected -- truncated, but buffer overflow possible! Encrypted = %d.",encrypted);
+    }
+  }
   assert(outsize == FRAME_BYTES(frame_size));
 }
 
@@ -786,14 +792,14 @@ static int stuff_buffer_basic(short *inptr, short *outptr, int stuff) {
   };
   if (stuff) {
     if (stuff == 1) {
-      debug(3, "+++++++++");
+      // debug(3, "+++++++++");
       // interpolate one sample
       //*outptr++ = dithered_vol(((long)inptr[-2] + (long)inptr[0]) >> 1);
       //*outptr++ = dithered_vol(((long)inptr[-1] + (long)inptr[1]) >> 1);
       *outptr++ = dithered_vol(shortmean(inptr[-2], inptr[0]));
       *outptr++ = dithered_vol(shortmean(inptr[-1], inptr[1]));
     } else if (stuff == -1) {
-      debug(3, "---------");
+      // debug(3, "---------");
       inptr++;
       inptr++;
     }