changeset 2183:6d40885b03ad libavcodec

ffmpeg short conversion got fixed somewhere, no need to workaround it - fixes amplitude bug
author alex
date Sun, 22 Aug 2004 12:40:57 +0000
parents 113732773bda
children 3378d0677903
files sonic.c
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/sonic.c	Sat Aug 21 19:19:35 2004 +0000
+++ b/sonic.c	Sun Aug 22 12:40:57 2004 +0000
@@ -501,10 +501,14 @@
     int i, version = 0;
 
     if (avctx->channels > MAX_CHANNELS)
+    {
+	av_log(avctx, AV_LOG_ERROR, "Only mono and stereo streams are supported by now\n");
         return -1; /* only stereo or mono for now */
+    }
 
     if (avctx->channels == 2)
 	s->mid_side = 1;
+
     if (avctx->codec->id == CODEC_ID_SONIC_LS)
     {
 	s->lossless = 1;
@@ -627,10 +631,12 @@
     // short -> internal
     for (i = 0; i < s->frame_size; i++)
     {
-	if (samples[i] < 0)
-	    s->int_samples[i] = samples[i]+32768;
-	else
-	    s->int_samples[i] = samples[i]-32768;
+//	if (samples[i] < 0)
+//	    s->int_samples[i] = samples[i]+32768;
+//	else
+//	    s->int_samples[i] = samples[i]-32768;
+	s->int_samples[i] = samples[i];
+//	av_log(NULL, AV_LOG_INFO, "%d\n", s->int_samples[i]);
     }
 
     if (!s->lossless)