From: ddennedy Date: Sun, 29 Aug 2004 22:44:48 +0000 (+0000) Subject: bugfix in waveform method X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=a580a839a05757f17185ef78b849f3e53dbd0ccc;p=melted bugfix in waveform method git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@398 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/src/framework/mlt_frame.c b/src/framework/mlt_frame.c index 204eaae..46c2aae 100644 --- a/src/framework/mlt_frame.c +++ b/src/framework/mlt_frame.c @@ -371,7 +371,7 @@ unsigned char *mlt_frame_get_waveform( mlt_frame this, double fps, int w, int h for ( j = 0; j < channels; j++ ) { /* the height of a "bar" is the ratio of the sample multiplied by the vertical resolution */ - int pcm_scaled = ( int )( ( double )( *pcm ) / 32767 * vertical_resolution ); + int pcm_scaled = ( int )( ( double )( *pcm ) / 32768 * vertical_resolution / 2 ); int height = pcm_scaled < 0 ? -pcm_scaled : pcm_scaled; int offset = j * samples * vertical_resolution; int displacement = pcm_scaled < 0 ? ( vertical_resolution / 2 ) : ( vertical_resolution / 2 - pcm_scaled ); @@ -383,6 +383,7 @@ unsigned char *mlt_frame_get_waveform( mlt_frame this, double fps, int w, int h pcm++; } } + return bitmap; }