Ticket #1104: mythtv_mm_mad.1.patch

File mythtv_mm_mad.1.patch, 1.1 KB (added by Mark Spieth, 16 years ago)
  • mythmusic/mythmusic/maddecoder.cpp

     
    469469    left = synth.pcm.samples[0];
    470470    right = synth.pcm.samples[1];
    471471
    472     freq = frame.header.samplerate;
    473     channels = MAD_NCHANNELS(&frame.header);
    474     bitrate = frame.header.bitrate / 1000;
     472    long newfreq = frame.header.samplerate;
     473    long newchannels = MAD_NCHANNELS(&frame.header);
     474    long newbitrate = frame.header.bitrate / 1000;
    475475
    476476    if (output())
    477477    {
    478         output()->Reconfigure(16, channels, freq, false /*AC3/DTS passthru*/);
    479         output()->SetSourceBitrate(bitrate);
     478        if ((newfreq != freq) || (newchannels != channels))
     479        {
     480            freq = newfreq;
     481            channels = newchannels;
     482            output()->Reconfigure(16, channels, freq, false /*AC3/DTS passthru*/);
     483        }
     484        if (newbitrate != bitrate)
     485        {
     486            bitrate = newbitrate;
     487            output()->SetSourceBitrate(bitrate);
     488        }
    480489    }
    481490
    482491    while (samples--)