Skip to content

Commit

Permalink
Merge pull request #4672 from anssih/fix/dvdplayer-samplerate
Browse files Browse the repository at this point in the history
dvdplayer sample rate fixes
  • Loading branch information
anssih committed May 10, 2014
2 parents 15822c4 + d74bd78 commit d8d745b
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h
Expand Up @@ -140,7 +140,7 @@ class CDVDAudioCodec
/*
* returns the samplerate for the encoded audio stream
*/
virtual int GetEncodedSampleRate() { return 0; }
virtual int GetEncodedSampleRate() { return GetSampleRate(); }

/*
* returns the data format for the decoded audio stream (eg AE_FMT_S16LE)
Expand Down
7 changes: 0 additions & 7 deletions xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp
Expand Up @@ -285,13 +285,6 @@ int CDVDAudioCodecFFmpeg::GetSampleRate()
return 0;
}

int CDVDAudioCodecFFmpeg::GetEncodedSampleRate()
{
if (m_pCodecContext)
return m_pCodecContext->sample_rate;
return 0;
}

enum AEDataFormat CDVDAudioCodecFFmpeg::GetDataFormat()
{
switch(m_pCodecContext->sample_fmt)
Expand Down
1 change: 0 additions & 1 deletion xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h
Expand Up @@ -42,7 +42,6 @@ class CDVDAudioCodecFFmpeg : public CDVDAudioCodec
virtual int GetChannels();
virtual CAEChannelInfo GetChannelMap();
virtual int GetSampleRate();
virtual int GetEncodedSampleRate();
virtual enum AEDataFormat GetDataFormat();
virtual const char* GetName() { return "FFmpeg"; }
virtual int GetBufferSize() { return m_iBuffered; }
Expand Down
2 changes: 1 addition & 1 deletion xbmc/cores/dvdplayer/DVDPlayerAudio.cpp
Expand Up @@ -286,7 +286,7 @@ int CDVDPlayerAudio::DecodeFrame(DVDAudioFrame &audioframe)
if (audioframe.pts == DVD_NOPTS_VALUE)
audioframe.pts = m_audioClock;

if (m_streaminfo.samplerate != audioframe.encoded_sample_rate)
if (audioframe.encoded_sample_rate && m_streaminfo.samplerate != audioframe.encoded_sample_rate)
{
// The sample rate has changed or we just got it for the first time
// for this stream. See if we should enable/disable passthrough due
Expand Down

0 comments on commit d8d745b

Please sign in to comment.