Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2117 from aballier/unknownaudioout

DVDAudioCodecFFmpeg: Convert unknown audio formats to float.
  • Loading branch information...
commit 0a6806f8c9fa24ac11ed70a9b11e0ec120d088e9 2 parents 8ce3d54 + 49eebad
@davilla davilla authored
View
8 xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp
@@ -42,6 +42,7 @@ CDVDAudioCodecFFmpeg::CDVDAudioCodecFFmpeg() : CDVDAudioCodec()
m_layout = 0;
m_bLpcmMode = false;
+ m_bNeedConversion = false;
m_pFrame1 = NULL;
m_iSampleFormat = AV_SAMPLE_FMT_NONE;
@@ -174,7 +175,7 @@ int CDVDAudioCodecFFmpeg::Decode(BYTE* pData, int iSize)
else
m_iBuffered = 0;
- if(m_bLpcmMode)
+ if(m_bLpcmMode || m_bNeedConversion)
ConvertToFloat();
return iBytesUsed;
@@ -277,9 +278,12 @@ enum AEDataFormat CDVDAudioCodecFFmpeg::GetDataFormat()
case AV_SAMPLE_FMT_S32: return AE_FMT_S32NE;
case AV_SAMPLE_FMT_FLT: return AE_FMT_FLOAT;
case AV_SAMPLE_FMT_DBL: return AE_FMT_DOUBLE;
- default:
+ case AV_SAMPLE_FMT_NONE:
assert(false);
return AE_FMT_INVALID;
+ default:
+ m_bNeedConversion = true;
+ return AE_FMT_FLOAT;
}
}
}
View
1  xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h
@@ -51,6 +51,7 @@ class CDVDAudioCodecFFmpeg : public CDVDAudioCodec
enum AVSampleFormat m_iSampleFormat;
CAEChannelInfo m_channelLayout;
bool m_bLpcmMode;
+ bool m_bNeedConversion;
AVFrame* m_pFrame1;
int m_iBufferSize1;
Please sign in to comment.
Something went wrong with that request. Please try again.