Permalink
Browse files

DVDAudioCodecFFmpeg: Convert unknown audio formats to float.

As of FFmpeg-1.1, some decoders started to output planar audio.
This fixes track ticket 13944.
  • Loading branch information...
1 parent e95ad75 commit 49eebad50451ac817de9bc735c742363a25f9ac5 @aballier aballier committed Jan 25, 2013
@@ -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;
}
}
}
@@ -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;

0 comments on commit 49eebad

Please sign in to comment.