Skip to content
This repository
Browse code

Merge pull request #2117 from aballier/unknownaudioout

DVDAudioCodecFFmpeg: Convert unknown audio formats to float.
  • Loading branch information...
commit 0a6806f8c9fa24ac11ed70a9b11e0ec120d088e9 2 parents 8ce3d54 + 49eebad
davilla authored January 25, 2013
8  xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp
@@ -42,6 +42,7 @@ CDVDAudioCodecFFmpeg::CDVDAudioCodecFFmpeg() : CDVDAudioCodec()
42 42
   m_layout = 0;
43 43
   
44 44
   m_bLpcmMode = false;
  45
+  m_bNeedConversion = false;
45 46
 
46 47
   m_pFrame1 = NULL;
47 48
   m_iSampleFormat = AV_SAMPLE_FMT_NONE;
@@ -174,7 +175,7 @@ int CDVDAudioCodecFFmpeg::Decode(BYTE* pData, int iSize)
174 175
   else
175 176
     m_iBuffered = 0;
176 177
     
177  
-  if(m_bLpcmMode)
  178
+  if(m_bLpcmMode || m_bNeedConversion)
178 179
     ConvertToFloat();
179 180
 
180 181
   return iBytesUsed;
@@ -277,9 +278,12 @@ enum AEDataFormat CDVDAudioCodecFFmpeg::GetDataFormat()
277 278
       case AV_SAMPLE_FMT_S32: return AE_FMT_S32NE;
278 279
       case AV_SAMPLE_FMT_FLT: return AE_FMT_FLOAT;
279 280
       case AV_SAMPLE_FMT_DBL: return AE_FMT_DOUBLE;
280  
-      default:
  281
+      case AV_SAMPLE_FMT_NONE:
281 282
         assert(false);
282 283
         return AE_FMT_INVALID;
  284
+      default:
  285
+        m_bNeedConversion = true;
  286
+        return AE_FMT_FLOAT;
283 287
     }
284 288
   }
285 289
 }
1  xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h
@@ -51,6 +51,7 @@ class CDVDAudioCodecFFmpeg : public CDVDAudioCodec
51 51
   enum AVSampleFormat m_iSampleFormat;  
52 52
   CAEChannelInfo      m_channelLayout;
53 53
   bool                m_bLpcmMode;  
  54
+  bool                m_bNeedConversion;
54 55
 
55 56
   AVFrame* m_pFrame1;
56 57
   int      m_iBufferSize1;

0 notes on commit 0a6806f

Please sign in to comment.
Something went wrong with that request. Please try again.