[vlc-devel] "equalizer-bands" corrupt/truncated occasionally

akash mehrotra mehrotra.akash at gmail.com
Fri Jun 17 00:13:44 CEST 2011


Adding on to the previous mail, replacing the code in the for loop with the
following also causes the corruption:

 for( int i = 0; i < BANDS; i++ )
   {
       const float f_val = 2;
       QString val = QString("%1").arg( f_val, 5, 'f', 1 );
       values += " " + val;
   }
   const char *psz_values = values.toAscii().constData();

  http://i.imgur.com/gD8dc.png    -- the 2nd string is still corrupted

On Fri, Jun 17, 2011 at 2:43 AM, akash mehrotra <mehrotra.akash at gmail.com>wrote:

> I'm trying to access the equalizer from the luahttp interface as a part of
> my GSoC project.
> For this, I'm accessing the equalizer-bands string and parsing the gain
> values from that string in the interface code.
>
> However, the string is corrupted/truncated sometimes when the equalizer is
> modified using the Qt interface.
> The linked screen shot ( http://i.imgur.com/qeCT7.png )displays the string
> and its hex value when the string is modified through the Qt interface (from
> extended_panels.cpp)
>
> I'm using this code to print the string(the part indented to the extreme
> left is the code I added for printing out the string) from
> modules/gui/qt4/components/extended_panels.cpp   :
>
> void Equalizer::setCoreBands()
> {
>     /**\todo smoothing */
>
>     QString values;
>     for( int i = 0; i < BANDS; i++ )
>     {
>         const float f_val = (float)( bands[i]->value() ) / 10 - 20;
>         QString val = QString("%1").arg( f_val, 5, 'f', 1 );
>         printf("%d\n",bands[i]->value()/10-20);
>         band_texts[i]->setText( band_frequencies[i] + "\n" + val + "dB" );
>         values += " " + val;
>     }
>     const char *psz_values = values.toAscii().constData();
>
>     aout_instance_t *p_aout = THEMIM->getAout();
>     if( p_aout )
>     {
>         //delCallbacks( p_aout );
>         var_SetString( p_aout, "equalizer-bands", psz_values );
> int i=0;
> while(psz_values[i]!='\0' && i<=100)
> printf("%02x",psz_values[i++]);
> printf("\n%s\n",psz_values);
>         //addCallbacks( p_aout );
>         vlc_object_release( p_aout );
>     }
> }
>
>
>
>
> Is this fixable, or should I workaround this assuming that the values of
> the last 3 bands may not always be available.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110617/92c1949a/attachment.html>


More information about the vlc-devel mailing list