Ticket #4981: audiooutput.patch

File audiooutput.patch, 3.2 KB (added by andrei@…, 12 years ago)

This should be applied on top of 4981-v3.patch

  • libs/libmyth/audiooutputdx.h

     
    5454    virtual int GetAudiotime(void);
    5555
    5656    // Volume control
    57     virtual int GetVolumeChannel(int channel); // Returns 0-100
     57    virtual int GetVolumeChannel(int channel) const; // Returns 0-100
    5858    virtual void SetVolumeChannel(int channel, int volume); // range 0-100 for vol
    5959
    6060 private:
  • libs/libmyth/audiooutputdx.cpp

     
    9595DEFINE_GUID( _KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF, WAVE_FORMAT_DOLBY_AC3_SPDIF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
    9696
    9797
    98 AudioOutputDX::AudioOutputDX(
    99     QString laudio_main_device,  QString           laudio_passthru_device,
    100     int     laudio_bits,         int               laudio_channels,
    101     int     laudio_samplerate,   AudioOutputSource lsource,
    102     bool    lset_initial_vol,    bool              laudio_passthru) :
    103     AudioOutputBase(laudio_main_device, laudio_passthru_device,
    104                     laudio_bits,        laudio_channels,
    105                     laudio_samplerate,  lsource,
    106                     lset_initial_vol,   laudio_passthru),
     98AudioOutputDX::AudioOutputDX(const AudioSettings &settings) :
     99    AudioOutputBase(settings),
    107100    dsound_dll(NULL),
    108101    dsobject(NULL),
    109102    dsbuffer(NULL),
     
    121114{
    122115    InitDirectSound();
    123116   
    124     Reconfigure(laudio_bits,       laudio_channels,
    125                 laudio_samplerate, laudio_passthru);
     117    Reconfigure(settings);
    126118}
    127119
    128120void AudioOutputDX::SetBlocking(bool blocking)
     
    130122    // FIXME: kedl: not sure what else could be required here?
    131123}
    132124
    133 void AudioOutputDX::Reconfigure(int audio_bits,
    134                                 int audio_channels,
    135                                 int audio_samplerate,
    136                                 bool audio_passthru)
     125void AudioOutputDX::Reconfigure(const AudioSettings &settings)
    137126{
    138127    if (dsbuffer)
    139128        DestroyDSBuffer();
    140129       
    141     CreateDSBuffer(audio_bits, audio_channels, audio_samplerate, false);
     130    CreateDSBuffer(settings.bits, settings.channels, settings.samplerate, false);
    142131   
    143132    awaiting_data = true;
    144133    paused = true;
    145134       
    146     effdsp = audio_samplerate;
    147     this->audio_bits = audio_bits;
    148     this->audio_channels = audio_channels;
    149     this->audio_passthru = audio_passthru;
     135    effdsp = settings.samplerate;
     136    this->audio_bits = settings.bits;
     137    this->audio_channels = settings.channels;
     138    this->audio_passthru = settings.use_passthru;
    150139}
    151140
    152141AudioOutputDX::~AudioOutputDX()
  • libs/libmyth/audiooutputwin.cpp

     
    203203    return m_nPkts * 1536 * 4;
    204204}
    205205
    206 int AudioOutputWin::GetVolumeChannel(int channel)
     206int AudioOutputWin::GetVolumeChannel(int channel) const
    207207{
    208208    DWORD dwVolume = 0xffffffff;
    209209    int Volume = 100;