From 9af650fc12de531f7ffcc4fb31a9a65b76fd3a11 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Tue, 10 Jun 2014 18:36:23 +0200 Subject: [PATCH] packages/mediacenter/xbmc-master: update FM patch Signed-off-by: Stephan Raue --- .../xbmc-master-995.01-fernetmenta.patch | 2321 ----------------- 1 file changed, 2321 deletions(-) diff --git a/packages/mediacenter/xbmc-master/patches/xbmc-master-995.01-fernetmenta.patch b/packages/mediacenter/xbmc-master/patches/xbmc-master-995.01-fernetmenta.patch index d0e58d26aa..9b4386061b 100644 --- a/packages/mediacenter/xbmc-master/patches/xbmc-master-995.01-fernetmenta.patch +++ b/packages/mediacenter/xbmc-master/patches/xbmc-master-995.01-fernetmenta.patch @@ -1,2324 +1,3 @@ -From 0c5819f5e591a95a3a08b352dd22bab83ab22e41 Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Tue, 3 Jun 2014 07:36:29 +0200 -Subject: [PATCH 01/35] AE: accept planar formats and timestamps at input - ---- - .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 46 +++++++++++++-- - xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h | 8 ++- - .../Engines/ActiveAE/ActiveAEBuffer.cpp | 35 ++++++++++-- - .../AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h | 7 ++- - .../AudioEngine/Engines/ActiveAE/ActiveAESink.cpp | 17 +++++- - .../AudioEngine/Engines/ActiveAE/ActiveAESink.h | 1 + - .../Engines/ActiveAE/ActiveAEStream.cpp | 66 +++++++++++----------- - .../AudioEngine/Engines/ActiveAE/ActiveAEStream.h | 5 +- - xbmc/cores/AudioEngine/Interfaces/AEStream.h | 23 ++++++-- - 9 files changed, 153 insertions(+), 55 deletions(-) - -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index 5e65e9a..2f71051 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -@@ -43,12 +43,14 @@ void CEngineStats::Reset(unsigned int sampleRate) - m_sinkSampleRate = sampleRate; - m_bufferedSamples = 0; - m_suspended = false; -+ m_playingPTS = 0; - } - --void CEngineStats::UpdateSinkDelay(const AEDelayStatus& status, int samples) -+void CEngineStats::UpdateSinkDelay(const AEDelayStatus& status, int samples, int64_t pts, int clockId) - { - CSingleLock lock(m_lock); - m_sinkDelay = status; -+ m_playingPTS = (clockId == m_clockId) ? pts : 0; - if (samples > m_bufferedSamples) - { - CLog::Log(LOGERROR, "CEngineStats::UpdateSinkDelay - inconsistency in buffer time"); -@@ -108,6 +110,31 @@ float CEngineStats::GetCacheTotal(CActiveAEStream *stream) - return MAX_CACHE_LEVEL + m_sinkCacheTotal; - } - -+int64_t CEngineStats::GetPlayingPTS() -+{ -+ CSingleLock lock(m_lock); -+ if (m_playingPTS == 0) -+ return 0; -+ -+ int64_t pts = m_playingPTS + m_sinkDelay.GetDelay()*1000; -+ -+ if (pts < 0) -+ return 0; -+ -+ return pts; -+} -+ -+int CEngineStats::Discontinuity(bool reset) -+{ -+ CSingleLock lock(m_lock); -+ m_playingPTS = 0; -+ if (reset) -+ m_clockId = 0; -+ else -+ m_clockId++; -+ return m_clockId; -+} -+ - float CEngineStats::GetWaterLevel() - { - CSingleLock lock(m_lock); -@@ -1063,7 +1090,7 @@ void CActiveAE::Configure(AEAudioFormat *desiredFmt) - else - { - outputFormat = m_sinkFormat; -- outputFormat.m_dataFormat = AE_FMT_FLOAT; -+ outputFormat.m_dataFormat = AE_IS_PLANAR(outputFormat.m_dataFormat) ? AE_FMT_FLOATP : AE_FMT_FLOAT; - outputFormat.m_frameSize = outputFormat.m_channelLayout.Count() * - (CAEUtil::DataFormatToBits(outputFormat.m_dataFormat) >> 3); - -@@ -1212,6 +1239,7 @@ CActiveAEStream* CActiveAE::CreateStream(MsgStreamNew *streamMsg) - stream->m_statsLock = m_stats.GetLock(); - stream->m_fadingSamples = 0; - stream->m_started = false; -+ stream->m_clockId = m_stats.Discontinuity(true); - - if (streamMsg->options & AESTREAM_PAUSED) - stream->m_paused = true; -@@ -1407,7 +1435,7 @@ void CActiveAE::ApplySettingsToFormat(AEAudioFormat &format, AudioSettings &sett - } - else - { -- format.m_dataFormat = AE_FMT_FLOAT; -+ format.m_dataFormat = AE_IS_PLANAR(format.m_dataFormat) ? AE_FMT_FLOATP : AE_FMT_FLOAT; - // consider user channel layout for those cases - // 1. input stream is multichannel - // 2. stereo upmix is selected -@@ -1905,13 +1933,13 @@ bool CActiveAE::RunStages() - CLog::Log(LOGWARNING,"ActiveAE::%s - viz ran out of free buffers", __FUNCTION__); - AEDelayStatus status; - m_stats.GetDelay(status); -- unsigned int now = XbmcThreads::SystemClockMillis(); -- unsigned int timestamp = now + status.GetDelay() * 1000; -+ int64_t now = XbmcThreads::SystemClockMillis(); -+ int64_t timestamp = now + status.GetDelay() * 1000; - busy |= m_vizBuffers->ResampleBuffers(timestamp); - while(!m_vizBuffers->m_outputSamples.empty()) - { - CSampleBuffer *buf = m_vizBuffers->m_outputSamples.front(); -- if ((now - buf->timestamp) & 0x80000000) -+ if ((now - buf->timestamp) < 0) - break; - else - { -@@ -1938,6 +1966,12 @@ bool CActiveAE::RunStages() - m_encoder->Encode(out->pkt->data[0], out->pkt->planes*out->pkt->linesize, - buf->pkt->data[0], buf->pkt->planes*buf->pkt->linesize); - buf->pkt->nb_samples = buf->pkt->max_nb_samples; -+ -+ // set pts of last sample -+ buf->pkt_start_offset = buf->pkt->nb_samples; -+ buf->timestamp = out->timestamp; -+ buf->clockId = out->clockId; -+ - out->Return(); - out = buf; - } -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h -index 41a1089..bfb65d6 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h -@@ -160,19 +160,23 @@ class CEngineStats - { - public: - void Reset(unsigned int sampleRate); -- void UpdateSinkDelay(const AEDelayStatus& status, int samples); -+ void UpdateSinkDelay(const AEDelayStatus& status, int samples, int64_t pts, int clockId = 0); - void AddSamples(int samples, std::list &streams); - void GetDelay(AEDelayStatus& status); - void GetDelay(AEDelayStatus& status, CActiveAEStream *stream); - float GetCacheTime(CActiveAEStream *stream); - float GetCacheTotal(CActiveAEStream *stream); - float GetWaterLevel(); -+ int64_t GetPlayingPTS(); -+ int Discontinuity(bool reset = false); - void SetSuspended(bool state); - void SetSinkCacheTotal(float time) { m_sinkCacheTotal = time; } - void SetSinkLatency(float time) { m_sinkLatency = time; } - bool IsSuspended(); - CCriticalSection *GetLock() { return &m_lock; } - protected: -+ int64_t m_playingPTS; -+ int m_clockId; - float m_sinkCacheTotal; - float m_sinkLatency; - int m_bufferedSamples; -@@ -242,6 +246,8 @@ class CActiveAE : public IAE, private CThread - uint8_t **AllocSoundSample(SampleConfig &config, int &samples, int &bytes_per_sample, int &planes, int &linesize); - void FreeSoundSample(uint8_t **data); - void GetDelay(AEDelayStatus& status, CActiveAEStream *stream) { m_stats.GetDelay(status, stream); } -+ int64_t GetPlayingPTS() { return m_stats.GetPlayingPTS(); } -+ int Discontinuity() { return m_stats.Discontinuity(); } - float GetCacheTime(CActiveAEStream *stream) { return m_stats.GetCacheTime(stream); } - float GetCacheTotal(CActiveAEStream *stream) { return m_stats.GetCacheTotal(stream); } - void FlushStream(CActiveAEStream *stream); -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp -index f7fde1a..9e834c6 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp -@@ -44,6 +44,8 @@ CSoundPacket::~CSoundPacket() - CSampleBuffer::CSampleBuffer() : pkt(NULL), pool(NULL) - { - refCount = 0; -+ timestamp = 0; -+ clockId = -1; - } - - CSampleBuffer::~CSampleBuffer() -@@ -218,7 +220,7 @@ void CActiveAEBufferPoolResample::ChangeResampler() - m_changeResampler = false; - } - --bool CActiveAEBufferPoolResample::ResampleBuffers(unsigned int timestamp) -+bool CActiveAEBufferPoolResample::ResampleBuffers(int64_t timestamp) - { - bool busy = false; - CSampleBuffer *in; -@@ -234,7 +236,11 @@ bool CActiveAEBufferPoolResample::ResampleBuffers(unsigned int timestamp) - { - in = m_inputSamples.front(); - m_inputSamples.pop_front(); -- in->timestamp = timestamp; -+ if (timestamp) -+ { -+ in->timestamp = timestamp; -+ in->clockId = -1; -+ } - m_outputSamples.push_back(in); - busy = true; - } -@@ -290,6 +296,29 @@ bool CActiveAEBufferPoolResample::ResampleBuffers(unsigned int timestamp) - busy = true; - m_empty = (out_samples == 0); - -+ if (in) -+ { -+ if (!timestamp) -+ { -+ m_lastSamplePts = in->timestamp; -+ m_procSample->clockId = in->clockId; -+ } -+ else -+ { -+ m_lastSamplePts = timestamp; -+ in->pkt_start_offset = 0; -+ m_procSample->clockId = -1; -+ } -+ -+ // pts of last sample we added to the buffer -+ m_lastSamplePts += (in->pkt->nb_samples-in->pkt_start_offset)/m_format.m_sampleRate * 1000; -+ } -+ -+ // calculate pts for last sample in m_procSample -+ int bufferedSamples = m_resampler->GetBufferedSamples(); -+ m_procSample->pkt_start_offset = m_procSample->pkt->nb_samples; -+ m_procSample->timestamp = m_lastSamplePts - bufferedSamples/m_format.m_sampleRate*1000; -+ - if ((m_drain || m_changeResampler) && m_empty) - { - if (m_fillPackets && m_procSample->pkt->nb_samples != 0) -@@ -304,7 +333,6 @@ bool CActiveAEBufferPoolResample::ResampleBuffers(unsigned int timestamp) - memset(m_procSample->pkt->data[i]+start, 0, m_procSample->pkt->linesize-start); - } - } -- m_procSample->timestamp = timestamp; - - // check if draining is finished - if (m_drain && m_procSample->pkt->nb_samples == 0) -@@ -322,7 +350,6 @@ bool CActiveAEBufferPoolResample::ResampleBuffers(unsigned int timestamp) - // some methods like encode require completely filled packets - else if (!m_fillPackets || (m_procSample->pkt->nb_samples == m_procSample->pkt->max_nb_samples)) - { -- m_procSample->timestamp = timestamp; - m_outputSamples.push_back(m_procSample); - m_procSample = NULL; - } -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h -index a854470..b0912be 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h -@@ -70,7 +70,9 @@ class CSampleBuffer - void Return(); - CSoundPacket *pkt; - CActiveAEBufferPool *pool; -- unsigned int timestamp; -+ int64_t timestamp; -+ int clockId; -+ int pkt_start_offset; - int refCount; - }; - -@@ -96,7 +98,7 @@ class CActiveAEBufferPoolResample : public CActiveAEBufferPool - virtual ~CActiveAEBufferPoolResample(); - virtual bool Create(unsigned int totaltime, bool remap, bool upmix, bool normalize = true); - void ChangeResampler(); -- bool ResampleBuffers(unsigned int timestamp = 0); -+ bool ResampleBuffers(int64_t timestamp = 0); - float GetDelay(); - void Flush(); - AEAudioFormat m_inputFormat; -@@ -113,6 +115,7 @@ class CActiveAEBufferPoolResample : public CActiveAEBufferPool - AEQuality m_resampleQuality; - bool m_stereoUpmix; - bool m_normalize; -+ int64_t m_lastSamplePts; - }; - - } -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp -index a7fb64d..7b8649d 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp -@@ -190,6 +190,7 @@ void CActiveAESink::StateMachine(int signal, Protocol *port, Message *msg) - reply.hasVolume = m_sink->HasVolume(); - m_state = S_TOP_CONFIGURED_IDLE; - m_extTimeout = 10000; -+ m_sinkLatency = (int64_t)(reply.latency * 1000); - msg->Reply(CSinkControlProtocol::ACC, &reply, sizeof(SinkReply)); - } - else -@@ -823,7 +824,7 @@ unsigned int CActiveAESink::OutputSamples(CSampleBuffer* samples) - m_extError = true; - CLog::Log(LOGERROR, "CActiveAESink::OutputSamples - failed"); - status.SetDelay(0); -- m_stats->UpdateSinkDelay(status, frames); -+ m_stats->UpdateSinkDelay(status, frames, 0); - return 0; - } - else -@@ -834,13 +835,23 @@ unsigned int CActiveAESink::OutputSamples(CSampleBuffer* samples) - m_extError = true; - CLog::Log(LOGERROR, "CActiveAESink::OutputSamples - sink returned error"); - status.SetDelay(0); -- m_stats->UpdateSinkDelay(status, samples->pool ? maxFrames : 0); -+ m_stats->UpdateSinkDelay(status, samples->pool ? maxFrames : 0, 0); - return 0; - } - frames -= written; - - m_sink->GetDelay(status); -- m_stats->UpdateSinkDelay(status, samples->pool ? written : 0); -+ -+ int64_t pts = 0; -+ if (samples->timestamp) -+ { -+ int pastSamples = samples->pkt->nb_samples - samples->pkt_start_offset; -+ pts = samples->timestamp + pastSamples/m_sinkFormat.m_sampleRate*1000; -+ pts -= m_sinkLatency; -+ if (pts < 0) -+ pts = 0; -+ } -+ m_stats->UpdateSinkDelay(status, samples->pool ? written : 0, pts, samples->clockId); - } - return status.delay; - } -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h -index a04cd6a..0650a70 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h -@@ -142,6 +142,7 @@ class CActiveAESink : private CThread - AEAudioFormat m_sinkFormat, m_requestedFormat; - CEngineStats *m_stats; - float m_volume; -+ int m_sinkLatency; - }; - - } -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -index 58428e3..ce67a31 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -@@ -192,59 +192,48 @@ unsigned int CActiveAEStream::GetSpace() - return m_streamFreeBuffers * m_streamSpace; - } - --unsigned int CActiveAEStream::AddData(void *data, unsigned int size) -+unsigned int CActiveAEStream::AddData(uint8_t* const *data, unsigned int offset, unsigned int frames, double pts) - { - Message *msg; -- unsigned int copied = 0; -- unsigned int bytesToCopy = size; -- uint8_t *buf = (uint8_t*)data; -+ int copied = 0; -+ int sourceFrames = frames; -+ uint8_t* const *buf = data; - -- while(copied < size) -+ while(copied < frames) - { -- buf = ((uint8_t*)data) + copied; -- bytesToCopy = size - copied; -+ sourceFrames = frames - copied; - - if (m_currentBuffer) - { -- // fill leftover buffer and copy it first -- if (m_leftoverBytes && bytesToCopy >= (m_format.m_frameSize - m_leftoverBytes)) -- { -- int fillbytes = m_format.m_frameSize - m_leftoverBytes; -- memcpy(m_leftoverBuffer+m_leftoverBytes, buf, fillbytes); -- copied += fillbytes; -- // leftover buffer will be copied on next cycle -- buf = m_leftoverBuffer; -- bytesToCopy = m_format.m_frameSize; -- m_leftoverBytes = 0; -- } -- - int start = m_currentBuffer->pkt->nb_samples * - m_currentBuffer->pkt->bytes_per_sample * - m_currentBuffer->pkt->config.channels / - m_currentBuffer->pkt->planes; - -- int freeSamples = m_currentBuffer->pkt->max_nb_samples - m_currentBuffer->pkt->nb_samples; -- int availableSamples = bytesToCopy / m_format.m_frameSize; -+ int freeSpace = m_currentBuffer->pkt->max_nb_samples - m_currentBuffer->pkt->nb_samples; -+ int minFrames = std::min(freeSpace, sourceFrames); -+ int planes = m_currentBuffer->pkt->planes; -+ int bufOffset = (offset + copied)*m_format.m_frameSize/planes; - -- // if we don't have a full frame, copy to leftover buffer -- if (!availableSamples && bytesToCopy) -+ if (!copied) - { -- memcpy(m_leftoverBuffer+m_leftoverBytes, buf, bytesToCopy); -- m_leftoverBytes = bytesToCopy; -- copied += bytesToCopy; -+ m_currentBuffer->timestamp = pts; -+ m_currentBuffer->clockId = m_clockId; -+ m_currentBuffer->pkt_start_offset = m_currentBuffer->pkt->nb_samples; - } - -- int samples = std::min(freeSamples, availableSamples); -- int bytes = samples * m_format.m_frameSize; -+ for (int i=0; ipkt->data[i]+start, buf[i]+bufOffset, minFrames*m_format.m_frameSize/planes); -+ } -+ copied += minFrames; - -- memcpy(m_currentBuffer->pkt->data[0] + start, buf, bytes); - { - CSingleLock lock(*m_statsLock); -- m_currentBuffer->pkt->nb_samples += samples; -- m_bufferedTime += (double)samples / m_currentBuffer->pkt->config.sample_rate; -+ m_currentBuffer->pkt->nb_samples += minFrames; -+ m_bufferedTime += (double)minFrames / m_currentBuffer->pkt->config.sample_rate; - } -- if (buf != m_leftoverBuffer) -- copied += bytes; -+ - if (m_currentBuffer->pkt->nb_samples == m_currentBuffer->pkt->max_nb_samples) - { - MsgStreamSample msgData; -@@ -261,6 +250,7 @@ unsigned int CActiveAEStream::AddData(void *data, unsigned int size) - if (msg->signal == CActiveAEDataProtocol::STREAMBUFFER) - { - m_currentBuffer = *((CSampleBuffer**)msg->data); -+ m_currentBuffer->timestamp = 0; - msg->Release(); - DecFreeBuffers(); - continue; -@@ -285,6 +275,16 @@ double CActiveAEStream::GetDelay() - return status.GetDelay(); - } - -+int64_t CActiveAEStream::GetPlayingPTS() -+{ -+ return AE.GetPlayingPTS(); -+} -+ -+void CActiveAEStream::Discontinuity() -+{ -+ m_clockId = AE.Discontinuity(); -+} -+ - bool CActiveAEStream::IsBuffering() - { - CSingleLock lock(m_streamLock); -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h -index 77d718b..70e8107 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h -@@ -42,8 +42,9 @@ class CActiveAEStream : public IAEStream - - public: - virtual unsigned int GetSpace(); -- virtual unsigned int AddData(void *data, unsigned int size); -+ virtual unsigned int AddData(uint8_t* const *data, unsigned int offset, unsigned int frames, double pts = 0.0); - virtual double GetDelay(); -+ virtual int64_t GetPlayingPTS(); - virtual bool IsBuffering(); - virtual double GetCacheTime(); - virtual double GetCacheTotal(); -@@ -76,6 +77,7 @@ class CActiveAEStream : public IAEStream - virtual void FadeVolume(float from, float to, unsigned int time); - virtual bool IsFading(); - virtual void RegisterSlave(IAEStream *stream); -+ virtual void Discontinuity(); - - protected: - -@@ -97,6 +99,7 @@ class CActiveAEStream : public IAEStream - CSampleBuffer *m_currentBuffer; - CSoundPacket *m_remapBuffer; - CActiveAEResample *m_remapper; -+ int m_clockId; - - // only accessed by engine - CActiveAEBufferPool *m_inputBuffers; -diff --git a/xbmc/cores/AudioEngine/Interfaces/AEStream.h b/xbmc/cores/AudioEngine/Interfaces/AEStream.h -index ed5e64a..f7c50b7 100644 ---- a/xbmc/cores/AudioEngine/Interfaces/AEStream.h -+++ b/xbmc/cores/AudioEngine/Interfaces/AEStream.h -@@ -50,12 +50,14 @@ class IAEStream - virtual unsigned int GetSpace() = 0; - - /** -- * Add interleaved PCM data to the stream -- * @param data The interleaved PCM data -- * @param size The size in bytes of data, if this is > GetSpace() only up to GetSpace() bytes will be consumed -- * @return The number of bytes consumed -+ * Add planar or interleaved PCM data to the stream -+ * @param data array of pointers to the planes -+ * @param offset to frame in frames -+ * @param frames number of frames -+ * @param pts timestamp -+ * @return The number of frames consumed - */ -- virtual unsigned int AddData(void *data, unsigned int size) = 0; -+ virtual unsigned int AddData(uint8_t* const *data, unsigned int offset, unsigned int frames, double pts = 0.0) = 0; - - /** - * Returns the time in seconds that it will take -@@ -65,6 +67,12 @@ class IAEStream - virtual double GetDelay() = 0; - - /** -+ * Returns playing PTS -+ * @return millis -+ */ -+ virtual int64_t GetPlayingPTS() = 0; -+ -+ /** - * Returns if the stream is buffering - * @return True if the stream is buffering - */ -@@ -225,5 +233,10 @@ class IAEStream - * Slave a stream to resume when this stream has drained - */ - virtual void RegisterSlave(IAEStream *stream) = 0; -+ -+ /** -+ * Sginal a clock change -+ */ -+ virtual void Discontinuity() = 0; - }; - --- -1.9.3 - - -From ae7cda6629c7180430a25d834ea83ab5d9f47d77 Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Mon, 2 Jun 2014 17:32:05 +0200 -Subject: [PATCH 02/35] dvdplayer audio: feed planar formats into ae - ---- - xbmc/cores/dvdplayer/DVDAudio.cpp | 128 +++----------------- - xbmc/cores/dvdplayer/DVDAudio.h | 4 - - .../dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h | 21 ++-- - .../DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp | 132 +++------------------ - .../DVDCodecs/Audio/DVDAudioCodecFFmpeg.h | 6 +- - xbmc/cores/dvdplayer/DVDPlayerAudio.cpp | 14 ++- - 6 files changed, 56 insertions(+), 249 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDAudio.cpp b/xbmc/cores/dvdplayer/DVDAudio.cpp -index 5166b9e..46e9509 100644 ---- a/xbmc/cores/dvdplayer/DVDAudio.cpp -+++ b/xbmc/cores/dvdplayer/DVDAudio.cpp -@@ -91,33 +91,11 @@ double CPTSOutputQueue::Current(double timestamp) - return m_current.pts + min(m_current.duration, (timestamp - m_current.timestamp)); - } - --/** \brief Reallocs the memory block pointed to by src by the size len. --* \param[in] src Pointer to a memory block. --* \param[in] len New size of the memory block. --* \exception realloc failed --* \return A pointer to the reallocated memory block. --*/ --static void* realloc_or_free(void* src, int len) throw(exception) --{ -- void* new_pBuffer = realloc(src, len); -- if (new_pBuffer) -- return new_pBuffer; -- else -- { -- CLog::Log(LOGERROR, "DVDAUDIO - %s : could not realloc the buffer", __FUNCTION__); -- free(src); -- throw exception(); -- } --} -- - CDVDAudio::CDVDAudio(volatile bool &bStop) - : m_bStop(bStop) - { - m_pAudioStream = NULL; - m_pAudioCallback = NULL; -- m_iBufferSize = 0; -- m_dwPacketSize = 0; -- m_pBuffer = NULL; - m_bPassthrough = false; - m_iBitsPerSample = 0; - m_iBitrate = 0; -@@ -130,8 +108,6 @@ CDVDAudio::~CDVDAudio() - CSingleLock lock (m_critSection); - if (m_pAudioStream) - CAEFactory::FreeStream(m_pAudioStream); -- -- free(m_pBuffer); - } - - bool CDVDAudio::Create(const DVDAudioFrame &audioframe, AVCodecID codec, bool needresampler) -@@ -162,14 +138,12 @@ bool CDVDAudio::Create(const DVDAudioFrame &audioframe, AVCodecID codec, bool ne - m_iBitsPerSample = audioframe.bits_per_sample; - m_bPassthrough = audioframe.passthrough; - m_channelLayout = audioframe.channel_layout; -- m_dwPacketSize = m_pAudioStream->GetFrameSize(); - - if(m_channelLayout.Count() && m_iBitrate && m_iBitsPerSample) - m_SecondsPerByte = 1.0 / (m_channelLayout.Count() * m_iBitrate * (m_iBitsPerSample>>3)); - else - m_SecondsPerByte = 0.0; - -- m_iBufferSize = 0; - SetDynamicRangeCompression((long)(CMediaSettings::Get().GetCurrentVideoSettings().m_VolumeAmplification * 100)); - - if (m_pAudioCallback) -@@ -185,11 +159,7 @@ void CDVDAudio::Destroy() - if (m_pAudioStream) - CAEFactory::FreeStream(m_pAudioStream); - -- free(m_pBuffer); -- m_pBuffer = NULL; -- m_dwPacketSize = 0; - m_pAudioStream = NULL; -- m_iBufferSize = 0; - m_iBitrate = 0; - m_iBitsPerSample = 0; - m_bPassthrough = false; -@@ -197,24 +167,28 @@ void CDVDAudio::Destroy() - m_time.Flush(); - } - --unsigned int CDVDAudio::AddPacketsRenderer(unsigned char* data, unsigned int len, CSingleLock &lock) -+unsigned int CDVDAudio::AddPackets(const DVDAudioFrame &audioframe) - { -+ CSingleLock lock (m_critSection); -+ - if(!m_pAudioStream) - return 0; - - //Calculate a timeout when this definitely should be done - double timeout; -- timeout = DVD_SEC_TO_TIME(m_pAudioStream->GetDelay() + len * m_SecondsPerByte); -+ timeout = DVD_SEC_TO_TIME(m_pAudioStream->GetDelay() + audioframe.nb_frames*audioframe.framesize * m_SecondsPerByte); - timeout += DVD_SEC_TO_TIME(1.0); - timeout += CDVDClock::GetAbsoluteClock(); - -- unsigned int total = len; -+ unsigned int total = audioframe.nb_frames; -+ unsigned int frames = audioframe.nb_frames; -+ unsigned int offset = 0; - do - { -- unsigned int copied = m_pAudioStream->AddData(data, len); -- data += copied; -- len -= copied; -- if (len < m_dwPacketSize) -+ unsigned int copied = m_pAudioStream->AddData(audioframe.data, offset, frames); -+ offset += copied; -+ frames -= copied; -+ if (frames <= 0) - break; - - if (copied == 0 && timeout < CDVDClock::GetAbsoluteClock()) -@@ -228,64 +202,12 @@ unsigned int CDVDAudio::AddPacketsRenderer(unsigned char* data, unsigned int len - lock.Enter(); - } while (!m_bStop); - -- return total - len; --} -- --unsigned int CDVDAudio::AddPackets(const DVDAudioFrame &audioframe) --{ -- CSingleLock lock (m_critSection); -- -- unsigned char* data = audioframe.data; -- unsigned int len = audioframe.size; -- -- unsigned int total = len; -- unsigned int copied; -- -- if (m_iBufferSize > 0) // See if there are carryover bytes from the last call. need to add them 1st. -- { -- copied = std::min(m_dwPacketSize - m_iBufferSize % m_dwPacketSize, len); // Smaller of either the data provided or the leftover data -- if(copied) -- { -- m_pBuffer = (uint8_t*)realloc_or_free(m_pBuffer, m_iBufferSize + copied); -- memcpy(m_pBuffer + m_iBufferSize, data, copied); // Tack the caller's data onto the end of the buffer -- data += copied; // Move forward in caller's data -- len -= copied; // Decrease amount of data available from caller -- m_iBufferSize += copied; // Increase amount of data available in buffer -- } -- -- if(m_iBufferSize < m_dwPacketSize) // If we don't have enough data to give to the renderer, wait until next time -- return copied; -- -- if(AddPacketsRenderer(m_pBuffer, m_iBufferSize, lock) != m_iBufferSize) -- { -- m_iBufferSize = 0; -- CLog::Log(LOGERROR, "%s - failed to add leftover bytes to render", __FUNCTION__); -- return copied; -- } -- -- m_iBufferSize = 0; -- if (!len) -- return copied; // We used up all the caller's data -- } -- -- copied = AddPacketsRenderer(data, len, lock); -- data += copied; -- len -= copied; -- -- // if we have more data left, save it for the next call to this funtion -- if (len > 0 && !m_bStop) -- { -- m_pBuffer = (uint8_t*)realloc_or_free(m_pBuffer, len); -- m_iBufferSize = len; -- memcpy(m_pBuffer, data, len); -- } -- -- double time_added = DVD_SEC_TO_TIME(m_SecondsPerByte * (data - audioframe.data)); -- double delay = GetDelay(); -- double timestamp = CDVDClock::GetAbsoluteClock(); -+ double time_added = DVD_SEC_TO_TIME(m_SecondsPerByte * audioframe.nb_frames * audioframe.framesize); -+ double delay = GetDelay(); -+ double timestamp = CDVDClock::GetAbsoluteClock(); - m_time.Add(audioframe.pts, delay - time_added, audioframe.duration, timestamp); - -- return total; -+ return total - frames; - } - - void CDVDAudio::Finish() -@@ -293,21 +215,6 @@ void CDVDAudio::Finish() - CSingleLock lock (m_critSection); - if (!m_pAudioStream) - return; -- -- unsigned int silence = m_dwPacketSize - m_iBufferSize % m_dwPacketSize; -- -- if(silence > 0 && m_iBufferSize > 0) -- { -- CLog::Log(LOGDEBUG, "CDVDAudio::Drain - adding %d bytes of silence, buffer size: %d, chunk size: %d", silence, m_iBufferSize, m_dwPacketSize); -- m_pBuffer = (uint8_t*)realloc_or_free(m_pBuffer, m_iBufferSize + silence); -- memset(m_pBuffer+m_iBufferSize, 0, silence); -- m_iBufferSize += silence; -- } -- -- if(AddPacketsRenderer(m_pBuffer, m_iBufferSize, lock) != m_iBufferSize) -- CLog::Log(LOGERROR, "CDVDAudio::Drain - failed to play the final %d bytes", m_iBufferSize); -- -- m_iBufferSize = 0; - } - - void CDVDAudio::Drain() -@@ -377,8 +284,6 @@ double CDVDAudio::GetDelay() - if(m_pAudioStream) - delay = m_pAudioStream->GetDelay(); - -- delay += m_SecondsPerByte * m_iBufferSize; -- - return delay * DVD_TIME_BASE; - } - -@@ -390,7 +295,6 @@ void CDVDAudio::Flush() - { - m_pAudioStream->Flush(); - } -- m_iBufferSize = 0; - m_time.Flush(); - } - -@@ -428,8 +332,6 @@ double CDVDAudio::GetCacheTime() - if(m_pAudioStream) - delay = m_pAudioStream->GetCacheTime(); - -- delay += m_SecondsPerByte * m_iBufferSize; -- - return delay; - } - -diff --git a/xbmc/cores/dvdplayer/DVDAudio.h b/xbmc/cores/dvdplayer/DVDAudio.h -index 4e22383..54c34e5 100644 ---- a/xbmc/cores/dvdplayer/DVDAudio.h -+++ b/xbmc/cores/dvdplayer/DVDAudio.h -@@ -87,10 +87,6 @@ class CDVDAudio - IAEStream *m_pAudioStream; - protected: - CPTSOutputQueue m_time; -- unsigned int AddPacketsRenderer(unsigned char* data, unsigned int len, CSingleLock &lock); -- uint8_t* m_pBuffer; // should be [m_dwPacketSize] -- unsigned int m_iBufferSize; -- unsigned int m_dwPacketSize; - CCriticalSection m_critSection; - - int m_iBitrate; -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h -index 7ebf84a..a935db7 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h -@@ -43,10 +43,12 @@ class CDVDCodecOptions; - - typedef struct stDVDAudioFrame - { -- uint8_t* data; -+ uint8_t* data[16]; - double pts; - double duration; -- unsigned int size; -+ unsigned int nb_frames; -+ unsigned int framesize; -+ unsigned int planes; - - int channel_count; - int encoded_channel_count; -@@ -92,22 +94,25 @@ class CDVDAudioCodec - */ - virtual void GetData(DVDAudioFrame &frame) - { -- frame.size = GetData(&frame.data); -- if(frame.size == 0u) -+ frame.nb_frames = 0; -+ frame.data_format = GetDataFormat(); -+ frame.channel_count = GetChannels(); -+ frame.framesize = (CAEUtil::DataFormatToBits(frame.data_format) >> 3) * frame.channel_count; -+ if(frame.framesize == 0) - return; -+ frame.nb_frames = GetData(frame.data)/frame.framesize; - frame.channel_layout = GetChannelMap(); - frame.channel_count = GetChannels(); -+ frame.planes = AE_IS_PLANAR(frame.data_format) ? frame.channel_count : 1; - frame.encoded_channel_count = GetEncodedChannels(); -- frame.data_format = GetDataFormat(); - frame.bits_per_sample = CAEUtil::DataFormatToBits(frame.data_format); - frame.sample_rate = GetSampleRate(); - frame.encoded_sample_rate = GetEncodedSampleRate(); - frame.passthrough = NeedPassthrough(); - frame.pts = DVD_NOPTS_VALUE; - // compute duration. -- int n = (frame.channel_count * frame.bits_per_sample * frame.sample_rate)>>3; -- if (n) -- frame.duration = ((double)frame.size * DVD_TIME_BASE) / n; -+ if (frame.sample_rate) -+ frame.duration = ((double)frame.nb_frames * DVD_TIME_BASE) / frame.sample_rate; - else - frame.duration = 0.0; - } -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp -index 6749c2e..5ba1e1b 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp -@@ -32,14 +32,8 @@ - - CDVDAudioCodecFFmpeg::CDVDAudioCodecFFmpeg() : CDVDAudioCodec() - { -- m_iBufferSize1 = 0; -- m_iBufferSize2 = 0; -- m_iBufferTotalSize2 = 0; -- m_pBuffer2 = NULL; -- - m_iBuffered = 0; - m_pCodecContext = NULL; -- m_pConvert = NULL; - m_bOpenedCodec = false; - - m_channels = 0; -@@ -47,6 +41,7 @@ CDVDAudioCodecFFmpeg::CDVDAudioCodecFFmpeg() : CDVDAudioCodec() - - m_pFrame1 = NULL; - m_iSampleFormat = AV_SAMPLE_FMT_NONE; -+ m_gotFrame = 0; - } - - CDVDAudioCodecFFmpeg::~CDVDAudioCodecFFmpeg() -@@ -113,12 +108,6 @@ void CDVDAudioCodecFFmpeg::Dispose() - if (m_pFrame1) av_free(m_pFrame1); - m_pFrame1 = NULL; - -- if (m_pConvert) -- swr_free(&m_pConvert); -- -- if (m_pBuffer2) -- av_freep(&m_pBuffer2); -- - if (m_pCodecContext) - { - if (m_bOpenedCodec) avcodec_close(m_pCodecContext); -@@ -127,33 +116,26 @@ void CDVDAudioCodecFFmpeg::Dispose() - m_pCodecContext = NULL; - } - -- m_iBufferSize1 = 0; -- m_iBufferSize2 = 0; -- m_iBufferTotalSize2 = 0; - m_iBuffered = 0; - } - - int CDVDAudioCodecFFmpeg::Decode(uint8_t* pData, int iSize) - { -- int iBytesUsed, got_frame; -+ int iBytesUsed; - if (!m_pCodecContext) return -1; - -- m_iBufferSize2 = 0; -- - AVPacket avpkt; - av_init_packet(&avpkt); - avpkt.data = pData; - avpkt.size = iSize; - iBytesUsed = avcodec_decode_audio4( m_pCodecContext - , m_pFrame1 -- , &got_frame -+ , &m_gotFrame - , &avpkt); -- if (iBytesUsed < 0 || !got_frame) -+ if (iBytesUsed < 0 || !m_gotFrame) - { -- m_iBufferSize1 = 0; - return iBytesUsed; - } -- m_iBufferSize1 = m_pFrame1->nb_samples * m_pCodecContext->channels * av_get_bytes_per_sample(m_pCodecContext->sample_fmt); - - /* some codecs will attempt to consume more data than what we gave */ - if (iBytesUsed > iSize) -@@ -162,104 +144,23 @@ int CDVDAudioCodecFFmpeg::Decode(uint8_t* pData, int iSize) - iBytesUsed = iSize; - } - -- if(m_iBufferSize1 == 0 && iBytesUsed >= 0) -+ if(iBytesUsed >= 0) - m_iBuffered += iBytesUsed; - else - m_iBuffered = 0; - -- bool convert = false; -- switch(m_pCodecContext->sample_fmt) -- { -- case AV_SAMPLE_FMT_U8: -- case AV_SAMPLE_FMT_S16: -- case AV_SAMPLE_FMT_S32: -- case AV_SAMPLE_FMT_FLT: -- case AV_SAMPLE_FMT_DBL: -- break; -- case AV_SAMPLE_FMT_NONE: -- CLog::Log(LOGERROR, "CDVDAudioCodecFFmpeg::Decode - invalid data format"); -- return -1; -- default: -- convert = true; -- } -- if(convert) -- ConvertToFloat(); -- - return iBytesUsed; - } - --void CDVDAudioCodecFFmpeg::ConvertToFloat() --{ -- if(m_pCodecContext->sample_fmt != AV_SAMPLE_FMT_FLT && m_iBufferSize1 > 0) -- { -- if(m_pConvert && (m_pCodecContext->sample_fmt != m_iSampleFormat || m_channels != m_pCodecContext->channels)) -- swr_free(&m_pConvert); -- -- if(!m_pConvert) -- { -- m_iSampleFormat = m_pCodecContext->sample_fmt; -- m_pConvert = swr_alloc_set_opts(NULL, -- av_get_default_channel_layout(m_pCodecContext->channels), AV_SAMPLE_FMT_FLT, m_pCodecContext->sample_rate, -- av_get_default_channel_layout(m_pCodecContext->channels), m_pCodecContext->sample_fmt, m_pCodecContext->sample_rate, -- 0, NULL); -- -- if(!m_pConvert || swr_init(m_pConvert) < 0) -- { -- CLog::Log(LOGERROR, "CDVDAudioCodecFFmpeg::Decode - Unable to convert %d to AV_SAMPLE_FMT_FLT", m_pCodecContext->sample_fmt); -- m_iBufferSize1 = 0; -- m_iBufferSize2 = 0; -- return; -- } -- } -- -- int needed_buf_size = av_samples_get_buffer_size(NULL, m_pCodecContext->channels, m_pFrame1->nb_samples, AV_SAMPLE_FMT_FLT, 0); -- if(m_iBufferTotalSize2 < needed_buf_size) -- { -- m_pBuffer2 = (uint8_t*)av_realloc(m_pBuffer2, needed_buf_size); -- if(!m_pBuffer2) -- { -- CLog::Log(LOGERROR, "CDVDAudioCodecFFmpeg::Decode - Unable to allocate a %i bytes buffer for resampling", needed_buf_size); -- m_iBufferSize1 = 0; -- m_iBufferSize2 = 0; -- m_iBufferTotalSize2 = 0; -- return; -- } -- m_iBufferTotalSize2 = needed_buf_size; -- } -- -- int outsamples; -- outsamples = swr_convert(m_pConvert, &m_pBuffer2, m_iBufferTotalSize2, (const uint8_t**)m_pFrame1->extended_data, m_pFrame1->nb_samples); -- -- if(outsamples < 0) -- { -- CLog::Log(LOGERROR, "CDVDAudioCodecFFmpeg::Decode - Unable to convert %d to AV_SAMPLE_FMT_FLT", (int)m_pCodecContext->sample_fmt); -- m_iBufferSize1 = 0; -- m_iBufferSize2 = 0; -- return; -- } -- -- if(outsamples < m_pFrame1->nb_samples) -- { -- CLog::Log(LOGWARNING, "CDVDAudioCodecFFmpeg::Decode - Resampler produced less samples than what it was given"); -- } -- -- m_iBufferSize1 = 0; -- m_iBufferSize2 = m_pFrame1->nb_samples * m_pCodecContext->channels * av_get_bytes_per_sample(AV_SAMPLE_FMT_FLT); -- } --} -- - int CDVDAudioCodecFFmpeg::GetData(uint8_t** dst) - { -- if(m_iBufferSize1) -- { -- *dst = m_pFrame1->data[0]; -- return m_iBufferSize1; -- } -- -- if(m_iBufferSize2) -+ if(m_gotFrame) - { -- *dst = m_pBuffer2; -- return m_iBufferSize2; -+ int planes = av_sample_fmt_is_planar(m_pCodecContext->sample_fmt) ? m_pFrame1->channels : 1; -+ for (int i=0; iextended_data[i]; -+ m_gotFrame = 0; -+ return m_pFrame1->nb_samples * m_pFrame1->channels * av_get_bytes_per_sample(m_pCodecContext->sample_fmt); - } - - return 0; -@@ -268,9 +169,8 @@ int CDVDAudioCodecFFmpeg::GetData(uint8_t** dst) - void CDVDAudioCodecFFmpeg::Reset() - { - if (m_pCodecContext) avcodec_flush_buffers(m_pCodecContext); -- m_iBufferSize1 = 0; -- m_iBufferSize2 = 0; - m_iBuffered = 0; -+ m_gotFrame = 0; - } - - int CDVDAudioCodecFFmpeg::GetChannels() -@@ -290,15 +190,19 @@ enum AEDataFormat CDVDAudioCodecFFmpeg::GetDataFormat() - switch(m_pCodecContext->sample_fmt) - { - case AV_SAMPLE_FMT_U8 : return AE_FMT_U8; -+ case AV_SAMPLE_FMT_U8P : return AE_FMT_U8P; - case AV_SAMPLE_FMT_S16: return AE_FMT_S16NE; -+ case AV_SAMPLE_FMT_S16P: return AE_FMT_S16NEP; - case AV_SAMPLE_FMT_S32: return AE_FMT_S32NE; -+ case AV_SAMPLE_FMT_S32P: return AE_FMT_S32NEP; - case AV_SAMPLE_FMT_FLT: return AE_FMT_FLOAT; -+ case AV_SAMPLE_FMT_FLTP: return AE_FMT_FLOATP; - case AV_SAMPLE_FMT_DBL: return AE_FMT_DOUBLE; -+ case AV_SAMPLE_FMT_DBLP: return AE_FMT_DOUBLEP; - case AV_SAMPLE_FMT_NONE: -+ default: - CLog::Log(LOGERROR, "CDVDAudioCodecFFmpeg::GetDataFormat - invalid data format"); - return AE_FMT_INVALID; -- default: -- return AE_FMT_FLOAT; - } - } - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h -index 3946e01..9d00c3f 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h -@@ -49,15 +49,11 @@ class CDVDAudioCodecFFmpeg : public CDVDAudioCodec - - protected: - AVCodecContext* m_pCodecContext; -- SwrContext* m_pConvert; - enum AVSampleFormat m_iSampleFormat; - CAEChannelInfo m_channelLayout; - - AVFrame* m_pFrame1; -- int m_iBufferSize1; -- uint8_t* m_pBuffer2; -- int m_iBufferSize2; -- int m_iBufferTotalSize2; -+ int m_gotFrame; - - bool m_bOpenedCodec; - int m_iBuffered; -diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp -index cd684bc..3141a9b 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp -@@ -246,7 +246,7 @@ int CDVDPlayerAudio::DecodeFrame(DVDAudioFrame &audioframe) - int result = 0; - - // make sure the sent frame is clean -- memset(&audioframe, 0, sizeof(DVDAudioFrame)); -+ audioframe.nb_frames = 0; - - while (!m_bStop) - { -@@ -280,7 +280,7 @@ int CDVDPlayerAudio::DecodeFrame(DVDAudioFrame &audioframe) - // get decoded data and the size of it - m_pAudioCodec->GetData(audioframe); - -- if (audioframe.size == 0) -+ if (audioframe.nb_frames == 0) - continue; - - if (audioframe.pts == DVD_NOPTS_VALUE) -@@ -532,7 +532,7 @@ void CDVDPlayerAudio::Process() - break; - } - -- if( audioframe.size == 0 ) -+ if( audioframe.nb_frames == 0 ) - continue; - - packetadded = true; -@@ -556,12 +556,16 @@ void CDVDPlayerAudio::Process() - - // Zero out the frame data if we are supposed to silence the audio - if (m_silence) -- memset(audioframe.data, 0, audioframe.size); -+ { -+ int size = audioframe.nb_frames * audioframe.framesize * audioframe.channel_count / audioframe.planes; -+ for (int i=0; i -Date: Sat, 24 May 2014 15:04:32 +0200 -Subject: [PATCH 03/35] paplayer: adapt to interface change of AE, feed entire - frames into AE - ---- - xbmc/cores/paplayer/DVDPlayerCodec.cpp | 99 ++++++++++++++++++++++++++++++---- - xbmc/cores/paplayer/DVDPlayerCodec.h | 17 +++++- - xbmc/cores/paplayer/PAPlayer.cpp | 9 ++-- - 3 files changed, 109 insertions(+), 16 deletions(-) - -diff --git a/xbmc/cores/paplayer/DVDPlayerCodec.cpp b/xbmc/cores/paplayer/DVDPlayerCodec.cpp -index 5a13093..31bc974 100644 ---- a/xbmc/cores/paplayer/DVDPlayerCodec.cpp -+++ b/xbmc/cores/paplayer/DVDPlayerCodec.cpp -@@ -20,6 +20,7 @@ - - #include "DVDPlayerCodec.h" - #include "cores/AudioEngine/Utils/AEUtil.h" -+#include "cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.h" - - #include "cores/dvdplayer/DVDInputStreams/DVDFactoryInputStream.h" - #include "cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.h" -@@ -42,10 +43,12 @@ DVDPlayerCodec::DVDPlayerCodec() - m_nAudioStream = -1; - m_audioPos = 0; - m_pPacket = NULL; -- m_decoded = NULL; - m_nDecodedLen = 0; - m_strFileName = ""; - m_bInited = false; -+ m_pResampler = NULL; -+ m_needConvert = false; -+ m_srcFrameSize = 0; - } - - DVDPlayerCodec::~DVDPlayerCodec() -@@ -71,7 +74,6 @@ bool DVDPlayerCodec::Init(const CStdString &strFile, unsigned int filecache) - DeInit(); - } - -- m_decoded = NULL; - m_nDecodedLen = 0; - - CStdString strFileToOpen = strFile; -@@ -224,6 +226,34 @@ bool DVDPlayerCodec::Init(const CStdString &strFile, unsigned int filecache) - } - m_pDemuxer->GetStreamCodecName(m_nAudioStream,m_CodecName); - -+ m_needConvert = false; -+ if (NeedConvert(m_DataFormat)) -+ { -+ m_needConvert = true; -+ m_pResampler = new ActiveAE::CActiveAEResample(); -+ m_pResampler->Init(ActiveAE::CActiveAEResample::GetAVChannelLayout(m_ChannelInfo), -+ m_ChannelInfo.Count(), -+ m_SampleRate, -+ ActiveAE::CActiveAEResample::GetAVSampleFormat(AE_FMT_FLOAT), -+ CAEUtil::DataFormatToUsedBits(AE_FMT_FLOAT), -+ CAEUtil::DataFormatToDitherBits(AE_FMT_FLOAT), -+ ActiveAE::CActiveAEResample::GetAVChannelLayout(m_ChannelInfo), -+ m_ChannelInfo.Count(), -+ m_SampleRate, -+ ActiveAE::CActiveAEResample::GetAVSampleFormat(m_DataFormat), -+ CAEUtil::DataFormatToUsedBits(m_DataFormat), -+ CAEUtil::DataFormatToDitherBits(m_DataFormat), -+ false, -+ false, -+ NULL, -+ AE_QUALITY_UNKNOWN); -+ m_planes = AE_IS_PLANAR(m_DataFormat) ? m_ChannelInfo.Count() : 1; -+ m_srcFormat = m_DataFormat; -+ m_srcFrameSize = (CAEUtil::DataFormatToBits(m_DataFormat)>>3) * m_ChannelInfo.Count(); -+ m_DataFormat = AE_FMT_FLOAT; -+ m_BitsPerSample = CAEUtil::DataFormatToBits(m_DataFormat); -+ } -+ - m_strFileName = strFile; - m_bInited = true; - -@@ -254,6 +284,9 @@ void DVDPlayerCodec::DeInit() - m_pAudioCodec = NULL; - } - -+ delete m_pResampler; -+ m_pResampler = NULL; -+ - // cleanup format information - m_TotalTime = 0; - m_SampleRate = 0; -@@ -264,7 +297,6 @@ void DVDPlayerCodec::DeInit() - m_Bitrate = 0; - - m_audioPos = 0; -- m_decoded = NULL; - m_nDecodedLen = 0; - - m_strFileName = ""; -@@ -287,7 +319,6 @@ int64_t DVDPlayerCodec::Seek(int64_t iSeekTime) - bool ret = m_pDemuxer->SeekTime((int)iSeekTime, seekback); - m_pAudioCodec->Reset(); - -- m_decoded = NULL; - m_nDecodedLen = 0; - - if (!ret) -@@ -298,17 +329,29 @@ int64_t DVDPlayerCodec::Seek(int64_t iSeekTime) - - int DVDPlayerCodec::ReadPCM(BYTE *pBuffer, int size, int *actualsize) - { -- if (m_decoded && m_nDecodedLen > 0) -+ if (m_nDecodedLen > 0) - { - int nLen = (size>3); -+ int frames = samples / m_Channels; -+ m_pResampler->Resample(&pBuffer, frames, m_audioPlanes, frames, 1.0); -+ for (int i=0; iGetData(&m_decoded); -+ // scale decoded bytes to destination format -+ m_nDecodedLen = m_pAudioCodec->GetData(m_audioPlanes); -+ if (m_needConvert) -+ m_nDecodedLen *= (m_BitsPerSample>>3) / (m_srcFrameSize / m_Channels); - - *actualsize = (m_nDecodedLen <= size) ? m_nDecodedLen : size; - if (*actualsize > 0) - { -- memcpy(pBuffer, m_decoded, *actualsize); -+ if (m_needConvert) -+ { -+ int samples = *actualsize / (m_BitsPerSample>>3); -+ int frames = samples / m_Channels; -+ m_pResampler->Resample(&pBuffer, frames, m_audioPlanes, frames, 1.0); -+ for (int i=0; im_decoder.GetData(samples); -+ // we want complete frames -+ samples -= samples % si->m_channelInfo.Count(); -+ -+ uint8_t* data = (uint8_t*)si->m_decoder.GetData(samples); - if (!data) - { - CLog::Log(LOGERROR, "PAPlayer::QueueData - Failed to get data from the decoder"); - return false; - } - -- unsigned int added = si->m_stream->AddData(data, samples * si->m_bytesPerSample); -- si->m_framesSent += added / si->m_bytesPerFrame; -+ unsigned int added = si->m_stream->AddData(&data, 0, samples/si->m_channelInfo.Count(), 0); -+ si->m_framesSent += added; - - const ICodec* codec = si->m_decoder.GetCodec(); - m_playerGUIData.m_cacheLevel = codec ? codec->GetCacheLevel() : 0; //update for GUI --- -1.9.3 - - -From a5b8f4e92253e6444a273a45ee32e73f292232a8 Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Sat, 24 May 2014 15:29:27 +0200 -Subject: [PATCH 04/35] dvdplayer: drop obsolete pcm audio codecs - ---- - .../DVDCodecs/Audio/DVDAudioCodecLPcm.cpp | 100 ------- - .../dvdplayer/DVDCodecs/Audio/DVDAudioCodecLPcm.h | 46 --- - .../dvdplayer/DVDCodecs/Audio/DVDAudioCodecPcm.cpp | 331 --------------------- - .../dvdplayer/DVDCodecs/Audio/DVDAudioCodecPcm.h | 60 ---- - xbmc/cores/dvdplayer/DVDCodecs/Audio/Makefile.in | 2 - - xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 51 +--- - 6 files changed, 1 insertion(+), 589 deletions(-) - delete mode 100644 xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecLPcm.cpp - delete mode 100644 xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecLPcm.h - delete mode 100644 xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPcm.cpp - delete mode 100644 xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPcm.h - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecLPcm.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecLPcm.cpp -deleted file mode 100644 -index ad33392..0000000 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecLPcm.cpp -+++ /dev/null -@@ -1,100 +0,0 @@ --/* -- * Copyright (C) 2005-2013 Team XBMC -- * http://xbmc.org -- * -- * This Program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2, or (at your option) -- * any later version. -- * -- * This Program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with XBMC; see the file COPYING. If not, see -- * . -- * -- */ -- --#include "DVDAudioCodecLPcm.h" --#include "DVDStreamInfo.h" -- --CDVDAudioCodecLPcm::CDVDAudioCodecLPcm() : CDVDAudioCodecPcm() --{ -- m_codecID = AV_CODEC_ID_NONE; -- m_bufferSize = 0; -- m_buffer = NULL; --} -- --CDVDAudioCodecLPcm::~CDVDAudioCodecLPcm() --{ -- delete m_buffer; --} -- --bool CDVDAudioCodecLPcm::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) --{ -- m_codecID = hints.codec; -- -- CDVDStreamInfo hints2(hints, true); -- hints2.codec = AV_CODEC_ID_NONE; --#if 0 -- if (hints.codecID = AV_CODEC_ID_LPCM_S24BE) hints2.codec = AV_CODEC_ID_PCM_S24BE; --#endif -- if (hints2.codec != AV_CODEC_ID_NONE) -- return CDVDAudioCodecPcm::Open(hints2, options); -- -- return false; --} -- --int CDVDAudioCodecLPcm::Decode(uint8_t* pData, int iSize) --{ -- uint8_t* d = m_buffer; -- uint8_t* s = pData; -- -- if (iSize > m_bufferSize) -- { -- delete m_buffer; -- d = m_buffer = new uint8_t[iSize]; -- if(!m_buffer) -- return -1; -- m_bufferSize = iSize; -- } -- -- if (iSize >= 12) -- { -- int iDecoded = 0; --#if 0 -- if (m_codecID == AV_CODEC_ID_LPCM_S24BE) --#endif -- { -- for (iDecoded = 0; iDecoded <= (iSize - 12); iDecoded += 12) -- { -- // first sample -- d[0] = s[0]; -- d[1] = s[1]; -- d[2] = s[8]; -- // second sample -- d[3] = s[2]; -- d[4] = s[3]; -- d[5] = s[9]; -- // third sample -- d[6] = s[4]; -- d[7] = s[5]; -- d[8] = s[10]; -- // fourth sample -- d[9] = s[6]; -- d[10] = s[7]; -- d[11] = s[11]; -- -- s += 12; -- d += 12; -- } -- } -- -- return CDVDAudioCodecPcm::Decode(m_buffer, iDecoded); -- } -- -- return iSize; --} -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecLPcm.h b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecLPcm.h -deleted file mode 100644 -index b459026..0000000 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecLPcm.h -+++ /dev/null -@@ -1,46 +0,0 @@ --#pragma once -- --/* -- * Copyright (C) 2005-2013 Team XBMC -- * http://xbmc.org -- * -- * This Program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2, or (at your option) -- * any later version. -- * -- * This Program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with XBMC; see the file COPYING. If not, see -- * . -- * -- */ -- --#include "DVDAudioCodec.h" --#include "DVDCodecs/DVDCodecs.h" --#include "DVDAudioCodecPcm.h" -- --class CDVDAudioCodecLPcm : public CDVDAudioCodecPcm --{ --public: -- CDVDAudioCodecLPcm(); -- virtual ~CDVDAudioCodecLPcm(); -- virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options); -- virtual int Decode(uint8_t* pData, int iSize); -- virtual const char* GetName() { return "lpcm"; } -- --protected: -- -- int m_bufferSize; -- uint8_t *m_buffer; -- -- AVCodecID m_codecID; -- --private: -- CDVDAudioCodecLPcm(const CDVDAudioCodecLPcm&); -- CDVDAudioCodecLPcm const& operator=(CDVDAudioCodecLPcm const&); --}; -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPcm.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPcm.cpp -deleted file mode 100644 -index 14ea4af..0000000 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPcm.cpp -+++ /dev/null -@@ -1,331 +0,0 @@ --/* -- * Copyright (C) 2005-2013 Team XBMC -- * http://xbmc.org -- * -- * This Program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2, or (at your option) -- * any later version. -- * -- * This Program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with XBMC; see the file COPYING. If not, see -- * . -- * -- */ -- --#include "DVDAudioCodecPcm.h" --#include "DVDStreamInfo.h" --#include "DVDCodecs/DVDCodecs.h" -- --/* from g711.c by SUN microsystems (unrestricted use) */ --#define SIGN_BIT (0x80) /* Sign bit for a A-law byte. */ --#define QUANT_MASK (0xf) /* Quantization field mask. */ --#define NSEGS (8) /* Number of A-law segments. */ --#define SEG_SHIFT (4) /* Left shift for segment number. */ --#define SEG_MASK (0x70) /* Segment field mask. */ -- --#define BIAS (0x84) /* Bias for linear code. */ -- --/* -- * alaw2linear() - Convert an A-law value to 16-bit linear PCM -- * -- */ --static int alaw2linear(unsigned char a_val) --{ -- int t; -- int seg; -- -- a_val ^= 0x55; -- -- t = a_val & QUANT_MASK; -- seg = ((unsigned)a_val & SEG_MASK) >> SEG_SHIFT; -- if(seg) t= (t + t + 1 + 32) << (seg + 2); -- else t= (t + t + 1 ) << 3; -- -- return ((a_val & SIGN_BIT) ? t : -t); --} -- --static int ulaw2linear(unsigned char u_val) --{ -- int t; -- -- /* Complement to obtain normal u-law value. */ -- u_val = ~u_val; -- -- /* -- * Extract and bias the quantization bits. Then -- * shift up by the segment number and subtract out the bias. -- */ -- t = ((u_val & QUANT_MASK) << 3) + BIAS; -- t <<= ((unsigned)u_val & SEG_MASK) >> SEG_SHIFT; -- -- return ((u_val & SIGN_BIT) ? (BIAS - t) : (t - BIAS)); --} -- --/** -- * \brief convert samples to 16 bit -- * \param bps byte per sample for the source format, must be >= 2 -- * \param le 0 for big-, 1 for little-endian -- * \param us 0 for signed, 1 for unsigned input -- * \param src input samples -- * \param samples output samples -- * \param src_len number of bytes in src -- */ --static inline void decode_to16(int bps, int le, int us, uint8_t **src, short **samples, int src_len) --{ -- register int n = src_len / bps; -- if (le) *src += bps - 2; -- for(;n>0;n--) { -- *(*samples)++ = ((*src)[le] << 8 | (*src)[1 - le]) - (us?0x8000:0); -- *src += bps; -- } -- if (le) *src -= bps - 2; --} -- --const uint8_t ff_reverse[256] = -- { -- 0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0, -- 0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8, -- 0x04,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4, -- 0x0C,0x8C,0x4C,0xCC,0x2C,0xAC,0x6C,0xEC,0x1C,0x9C,0x5C,0xDC,0x3C,0xBC,0x7C,0xFC, -- 0x02,0x82,0x42,0xC2,0x22,0xA2,0x62,0xE2,0x12,0x92,0x52,0xD2,0x32,0xB2,0x72,0xF2, -- 0x0A,0x8A,0x4A,0xCA,0x2A,0xAA,0x6A,0xEA,0x1A,0x9A,0x5A,0xDA,0x3A,0xBA,0x7A,0xFA, -- 0x06,0x86,0x46,0xC6,0x26,0xA6,0x66,0xE6,0x16,0x96,0x56,0xD6,0x36,0xB6,0x76,0xF6, -- 0x0E,0x8E,0x4E,0xCE,0x2E,0xAE,0x6E,0xEE,0x1E,0x9E,0x5E,0xDE,0x3E,0xBE,0x7E,0xFE, -- 0x01,0x81,0x41,0xC1,0x21,0xA1,0x61,0xE1,0x11,0x91,0x51,0xD1,0x31,0xB1,0x71,0xF1, -- 0x09,0x89,0x49,0xC9,0x29,0xA9,0x69,0xE9,0x19,0x99,0x59,0xD9,0x39,0xB9,0x79,0xF9, -- 0x05,0x85,0x45,0xC5,0x25,0xA5,0x65,0xE5,0x15,0x95,0x55,0xD5,0x35,0xB5,0x75,0xF5, -- 0x0D,0x8D,0x4D,0xCD,0x2D,0xAD,0x6D,0xED,0x1D,0x9D,0x5D,0xDD,0x3D,0xBD,0x7D,0xFD, -- 0x03,0x83,0x43,0xC3,0x23,0xA3,0x63,0xE3,0x13,0x93,0x53,0xD3,0x33,0xB3,0x73,0xF3, -- 0x0B,0x8B,0x4B,0xCB,0x2B,0xAB,0x6B,0xEB,0x1B,0x9B,0x5B,0xDB,0x3B,0xBB,0x7B,0xFB, -- 0x07,0x87,0x47,0xC7,0x27,0xA7,0x67,0xE7,0x17,0x97,0x57,0xD7,0x37,0xB7,0x77,0xF7, -- 0x0F,0x8F,0x4F,0xCF,0x2F,0xAF,0x6F,0xEF,0x1F,0x9F,0x5F,0xDF,0x3F,0xBF,0x7F,0xFF, -- }; -- --CDVDAudioCodecPcm::CDVDAudioCodecPcm() : CDVDAudioCodec() --{ -- m_iSourceChannels = 0; -- m_iSourceSampleRate = 0; -- m_iSourceBitrate = 0; -- m_decodedDataSize = 0; -- m_codecID = AV_CODEC_ID_NONE; -- m_iOutputChannels = 0; -- -- m_decodedData = NULL; -- m_decodedDataBufSize = 0; -- memset(table, 0, sizeof(table)); --} -- --CDVDAudioCodecPcm::~CDVDAudioCodecPcm() --{ -- Dispose(); -- delete m_decodedData; --} -- --bool CDVDAudioCodecPcm::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) --{ -- SetDefault(); -- -- m_codecID = hints.codec; -- m_iSourceChannels = hints.channels; -- m_iSourceSampleRate = hints.samplerate; -- m_iSourceBitrate = 16; -- -- switch (m_codecID) -- { -- case AV_CODEC_ID_PCM_ALAW: -- { -- for (int i = 0; i < 256; i++) table[i] = alaw2linear(i); -- break; -- } -- case AV_CODEC_ID_PCM_MULAW: -- { -- for (int i = 0; i < 256; i++) table[i] = ulaw2linear(i); -- break; -- } -- default: -- { -- break; -- } -- } -- -- // set desired output -- m_iOutputChannels = m_iSourceChannels; -- -- return true; --} -- --void CDVDAudioCodecPcm::Dispose() --{ --} -- --int CDVDAudioCodecPcm::Decode(uint8_t* pData, int iSize) --{ -- int n; -- short *samples; -- uint8_t *src; -- -- samples = (short*)m_decodedData; -- src = pData; -- int buf_size = iSize; -- -- if (iSize > m_decodedDataBufSize) -- { -- delete m_decodedData; -- samples = m_decodedData = new short[iSize]; -- if(!m_decodedData) -- return -1; -- m_decodedDataBufSize = iSize; -- } -- -- switch (m_codecID) -- { -- case AV_CODEC_ID_PCM_S32LE: -- decode_to16(4, 1, 0, &src, &samples, buf_size); -- break; -- case AV_CODEC_ID_PCM_S32BE: -- decode_to16(4, 0, 0, &src, &samples, buf_size); -- break; -- case AV_CODEC_ID_PCM_U32LE: -- decode_to16(4, 1, 1, &src, &samples, buf_size); -- break; -- case AV_CODEC_ID_PCM_U32BE: -- decode_to16(4, 0, 1, &src, &samples, buf_size); -- break; -- case AV_CODEC_ID_PCM_S24LE: -- decode_to16(3, 1, 0, &src, &samples, buf_size); -- break; -- case AV_CODEC_ID_PCM_S24BE: -- decode_to16(3, 0, 0, &src, &samples, buf_size); -- break; -- case AV_CODEC_ID_PCM_U24LE: -- decode_to16(3, 1, 1, &src, &samples, buf_size); -- break; -- case AV_CODEC_ID_PCM_U24BE: -- decode_to16(3, 0, 1, &src, &samples, buf_size); -- break; -- case AV_CODEC_ID_PCM_S24DAUD: -- n = buf_size / 3; -- for(;n>0;n--) { -- uint32_t v = src[0] << 16 | src[1] << 8 | src[2]; -- v >>= 4; // sync flags are here -- *samples++ = ff_reverse[(v >> 8) & 0xff] + -- (ff_reverse[v & 0xff] << 8); -- src += 3; -- } -- break; -- case AV_CODEC_ID_PCM_S16LE: -- n = buf_size >> 1; -- for(;n>0;n--) { -- *samples++ = src[0] | (src[1] << 8); -- src += 2; -- } -- break; -- case AV_CODEC_ID_PCM_S16BE: -- n = buf_size >> 1; -- for(;n>0;n--) { -- *samples++ = (src[0] << 8) | src[1]; -- src += 2; -- } -- break; -- case AV_CODEC_ID_PCM_U16LE: -- n = buf_size >> 1; -- for(;n>0;n--) { -- *samples++ = (src[0] | (src[1] << 8)) - 0x8000; -- src += 2; -- } -- break; -- case AV_CODEC_ID_PCM_U16BE: -- n = buf_size >> 1; -- for(;n>0;n--) { -- *samples++ = ((src[0] << 8) | src[1]) - 0x8000; -- src += 2; -- } -- break; -- case AV_CODEC_ID_PCM_S8: -- n = buf_size; -- for(;n>0;n--) { -- *samples++ = src[0] << 8; -- src++; -- } -- break; -- case AV_CODEC_ID_PCM_U8: -- n = buf_size; -- for(;n>0;n--) { -- *samples++ = ((int)src[0] - 128) << 8; -- src++; -- } -- break; -- case AV_CODEC_ID_PCM_ALAW: -- case AV_CODEC_ID_PCM_MULAW: -- n = buf_size; -- for(;n>0;n--) { -- *samples++ = table[src[0]]; -- src++; -- } -- break; -- default: -- return -1; -- } -- -- m_decodedDataSize = (uint8_t*)samples - (uint8_t*)m_decodedData; -- return iSize; --} -- --int CDVDAudioCodecPcm::GetData(uint8_t** dst) --{ -- *dst = (uint8_t*)m_decodedData; -- return m_decodedDataSize; --} -- --void CDVDAudioCodecPcm::SetDefault() --{ -- m_iSourceChannels = 0; -- m_iSourceSampleRate = 0; -- m_iSourceBitrate = 0; -- m_decodedDataSize = 0; -- m_codecID = AV_CODEC_ID_NONE; --} -- --void CDVDAudioCodecPcm::Reset() --{ -- //SetDefault(); --} -- --int CDVDAudioCodecPcm::GetChannels() --{ -- return m_iOutputChannels; --} -- --CAEChannelInfo CDVDAudioCodecPcm::GetChannelMap() --{ -- assert(m_iOutputChannels > 0 && m_iOutputChannels <= 8); -- static enum AEChannel map[8][9] = -- { -- /* MONO */ {AE_CH_FC, AE_CH_NULL, }, -- /* STEREO */ {AE_CH_FL, AE_CH_FR, AE_CH_NULL, }, -- /* 3.0 ? */ {AE_CH_FL, AE_CH_FR, AE_CH_FC, AE_CH_NULL, }, -- /* 4.0 ? */ {AE_CH_FL, AE_CH_FR, AE_CH_BL, AE_CH_BR , AE_CH_NULL, }, -- /* 5.0 */ {AE_CH_FL, AE_CH_FR, AE_CH_FC, AE_CH_BL , AE_CH_BR, AE_CH_NULL }, -- /* 5.1 */ {AE_CH_FL, AE_CH_FR, AE_CH_FC, AE_CH_LFE, AE_CH_BL, AE_CH_BR, AE_CH_NULL, }, -- /* 7.0 ? */ {AE_CH_FL, AE_CH_FR, AE_CH_FC, AE_CH_BL , AE_CH_BR, AE_CH_SL, AE_CH_SR, AE_CH_NULL }, -- /* 7.1 ? */ {AE_CH_FL, AE_CH_FR, AE_CH_FC, AE_CH_LFE, AE_CH_BL, AE_CH_BR, AE_CH_SL, AE_CH_SR, AE_CH_NULL} -- }; -- -- return map[m_iOutputChannels - 1]; --} -- --int CDVDAudioCodecPcm::GetSampleRate() --{ -- return m_iSourceSampleRate; --} -- --enum AEDataFormat CDVDAudioCodecPcm::GetDataFormat() --{ -- return AE_FMT_S16NE; --} -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPcm.h b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPcm.h -deleted file mode 100644 -index c2a36d0..0000000 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPcm.h -+++ /dev/null -@@ -1,60 +0,0 @@ --#pragma once -- --/* -- * Copyright (C) 2005-2013 Team XBMC -- * http://xbmc.org -- * -- * This Program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2, or (at your option) -- * any later version. -- * -- * This Program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with XBMC; see the file COPYING. If not, see -- * . -- * -- */ -- --#include "DVDAudioCodec.h" -- --class CDVDAudioCodecPcm : public CDVDAudioCodec --{ --public: -- CDVDAudioCodecPcm(); -- virtual ~CDVDAudioCodecPcm(); -- virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options); -- virtual void Dispose(); -- virtual int Decode(uint8_t* pData, int iSize); -- virtual int GetData(uint8_t** dst); -- virtual void Reset(); -- virtual int GetChannels(); -- virtual CAEChannelInfo GetChannelMap(); -- virtual int GetSampleRate(); -- virtual enum AEDataFormat GetDataFormat(); -- virtual const char* GetName() { return "pcm"; } -- --protected: -- virtual void SetDefault(); -- -- short* m_decodedData; -- int m_decodedDataBufSize; -- int m_decodedDataSize; -- -- AVCodecID m_codecID; -- int m_iSourceSampleRate; -- int m_iSourceChannels; -- int m_iSourceBitrate; -- -- int m_iOutputChannels; -- -- short table[256]; -- --private: -- CDVDAudioCodecPcm(const CDVDAudioCodecPcm&); -- CDVDAudioCodecPcm const& operator=(CDVDAudioCodecPcm const&); --}; -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/Makefile.in b/xbmc/cores/dvdplayer/DVDCodecs/Audio/Makefile.in -index cb6b3d7..6446ee9 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/Makefile.in -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/Makefile.in -@@ -3,9 +3,7 @@ INCLUDES+=-I@abs_top_srcdir@/xbmc/cores/dvdplayer - CXXFLAGS+=-DHAVE_MMX - - SRCS = DVDAudioCodecFFmpeg.cpp --SRCS += DVDAudioCodecLPcm.cpp - SRCS += DVDAudioCodecPassthrough.cpp --SRCS += DVDAudioCodecPcm.cpp - - LIB=Audio.a - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -index 402093d..f77ac40 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -@@ -25,6 +25,7 @@ - #include "Video/DVDVideoCodec.h" - #include "Audio/DVDAudioCodec.h" - #include "Overlay/DVDOverlayCodec.h" -+#include "cores/dvdplayer/DVDCodecs/DVDCodecs.h" - - #if defined(TARGET_DARWIN_OSX) - #include "Video/DVDVideoCodecVDA.h" -@@ -48,8 +49,6 @@ - #include "android/activity/AndroidFeatures.h" - #endif - #include "Audio/DVDAudioCodecFFmpeg.h" --#include "Audio/DVDAudioCodecPcm.h" --#include "Audio/DVDAudioCodecLPcm.h" - #include "Audio/DVDAudioCodecPassthrough.h" - #include "Overlay/DVDOverlayCodecSSA.h" - #include "Overlay/DVDOverlayCodecText.h" -@@ -326,54 +325,6 @@ CDVDAudioCodec* CDVDFactoryCodec::CreateAudioCodec( CDVDStreamInfo &hint) - pCodec = OpenCodec( new CDVDAudioCodecPassthrough(), hint, options ); - if( pCodec ) return pCodec; - -- switch (hint.codec) -- { -- case AV_CODEC_ID_MP2: -- case AV_CODEC_ID_MP3: -- { -- pCodec = OpenCodec( new CDVDAudioCodecFFmpeg(), hint, options ); -- if( pCodec ) return pCodec; -- break; -- } -- case AV_CODEC_ID_PCM_S32LE: -- case AV_CODEC_ID_PCM_S32BE: -- case AV_CODEC_ID_PCM_U32LE: -- case AV_CODEC_ID_PCM_U32BE: -- case AV_CODEC_ID_PCM_S24LE: -- case AV_CODEC_ID_PCM_S24BE: -- case AV_CODEC_ID_PCM_U24LE: -- case AV_CODEC_ID_PCM_U24BE: -- case AV_CODEC_ID_PCM_S24DAUD: -- case AV_CODEC_ID_PCM_S16LE: -- case AV_CODEC_ID_PCM_S16BE: -- case AV_CODEC_ID_PCM_U16LE: -- case AV_CODEC_ID_PCM_U16BE: -- case AV_CODEC_ID_PCM_S8: -- case AV_CODEC_ID_PCM_U8: -- case AV_CODEC_ID_PCM_ALAW: -- case AV_CODEC_ID_PCM_MULAW: -- { -- pCodec = OpenCodec( new CDVDAudioCodecPcm(), hint, options ); -- if( pCodec ) return pCodec; -- break; -- } --#if 0 -- //case AV_CODEC_ID_LPCM_S16BE: -- //case AV_CODEC_ID_LPCM_S20BE: -- case AV_CODEC_ID_LPCM_S24BE: -- { -- pCodec = OpenCodec( new CDVDAudioCodecLPcm(), hint, options ); -- if( pCodec ) return pCodec; -- break; -- } --#endif -- default: -- { -- pCodec = NULL; -- break; -- } -- } -- - pCodec = OpenCodec( new CDVDAudioCodecFFmpeg(), hint, options ); - if( pCodec ) return pCodec; - --- -1.9.3 - - -From bf6e91c50eb36469ddab4d7b3e9feae54552656c Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Wed, 28 May 2014 10:41:27 +0200 -Subject: [PATCH 05/35] WASAPI: fall back to float if engine requests a planar - format - ---- - xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp -index 3d2e9d2..43448bf 100644 ---- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp -+++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp -@@ -1030,8 +1030,14 @@ bool CAESinkWASAPI::InitializeExclusive(AEAudioFormat &format) - - if (format.m_dataFormat <= AE_FMT_FLOAT) - BuildWaveFormatExtensible(format, wfxex); -- else -+ else if (AE_IS_RAW(format.m_dataFormat)) - BuildWaveFormatExtensibleIEC61397(format, wfxex_iec61937); -+ else -+ { -+ // planar formats are currently not supported by this sink -+ format.m_dataFormat = AE_FMT_FLOAT; -+ BuildWaveFormatExtensible(format, wfxex); -+ } - - /* Test for incomplete format and provide defaults */ - if (format.m_sampleRate == 0 || --- -1.9.3 - - -From 1ecd7d04c0bc1c3a74d9e183966f10a3cc512b83 Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Wed, 28 May 2014 09:20:33 +0200 -Subject: [PATCH 06/35] AESinkPULSE: Correctly handle unsupported formats and - fallback to float - ---- - xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp -index 26225ae..861a86a 100644 ---- a/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp -+++ b/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp -@@ -484,6 +484,14 @@ bool CAESinkPULSE::Initialize(AEAudioFormat &format, std::string &device) - struct pa_channel_map map; - pa_channel_map_init(&map); - -+ // PULSE cannot cope with e.g. planar formats so we fallback to FLOAT -+ // when we receive an invalid pulse format -+ if (AEFormatToPulseFormat(format.m_dataFormat) == PA_SAMPLE_INVALID) -+ { -+ CLog::Log(LOGDEBUG, "PULSE does not support format: %s - will fallback to AE_FMT_FLOAT", CAEUtil::DataFormatToStr(format.m_dataFormat)); -+ format.m_dataFormat = AE_FMT_FLOAT; -+ } -+ - m_passthrough = AE_IS_RAW(format.m_dataFormat); - - if(m_passthrough) --- -1.9.3 - - -From 1cf17b041210c3201cc7fe50e7b32b6492b65418 Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sat, 7 Jun 2014 23:22:35 +0200 -Subject: [PATCH 07/35] XCode: Adapt after PCM/LPCM changes - ---- - XBMC.xcodeproj/project.pbxproj | 20 -------------------- - 1 file changed, 20 deletions(-) - -diff --git a/XBMC.xcodeproj/project.pbxproj b/XBMC.xcodeproj/project.pbxproj -index 1846b9b..60dc005 100644 ---- a/XBMC.xcodeproj/project.pbxproj -+++ b/XBMC.xcodeproj/project.pbxproj -@@ -1450,9 +1450,7 @@ - DFF0F15617528350002DA3A4 /* LibraryLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E14ED0D25F9F900618676 /* LibraryLoader.cpp */; }; - DFF0F15717528350002DA3A4 /* SoLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E14F40D25F9F900618676 /* SoLoader.cpp */; }; - DFF0F15817528350002DA3A4 /* DVDAudioCodecFFmpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E15070D25F9F900618676 /* DVDAudioCodecFFmpeg.cpp */; }; -- DFF0F15A17528350002DA3A4 /* DVDAudioCodecLPcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E15110D25F9F900618676 /* DVDAudioCodecLPcm.cpp */; }; - DFF0F15B17528350002DA3A4 /* DVDAudioCodecPassthrough.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB6610615374E80006B8FF1 /* DVDAudioCodecPassthrough.cpp */; }; -- DFF0F15D17528350002DA3A4 /* DVDAudioCodecPcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E15150D25F9F900618676 /* DVDAudioCodecPcm.cpp */; }; - DFF0F15E17528350002DA3A4 /* DVDOverlayCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFDA3152160E34230047A626 /* DVDOverlayCodec.cpp */; }; - DFF0F15F17528350002DA3A4 /* DVDOverlayCodecCC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E152B0D25F9F900618676 /* DVDOverlayCodecCC.cpp */; }; - DFF0F16017528350002DA3A4 /* DVDOverlayCodecFFmpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E152D0D25F9F900618676 /* DVDOverlayCodecFFmpeg.cpp */; }; -@@ -2297,8 +2295,6 @@ - E38E1F790D25F9FD00618676 /* DVDAudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E14FC0D25F9F900618676 /* DVDAudio.cpp */; }; - E38E1F7A0D25F9FD00618676 /* DVDClock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E14FE0D25F9F900618676 /* DVDClock.cpp */; }; - E38E1F7B0D25F9FD00618676 /* DVDAudioCodecFFmpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E15070D25F9F900618676 /* DVDAudioCodecFFmpeg.cpp */; }; -- E38E1F800D25F9FD00618676 /* DVDAudioCodecLPcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E15110D25F9F900618676 /* DVDAudioCodecLPcm.cpp */; }; -- E38E1F820D25F9FD00618676 /* DVDAudioCodecPcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E15150D25F9F900618676 /* DVDAudioCodecPcm.cpp */; }; - E38E1F840D25F9FD00618676 /* DVDCodecUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E15220D25F9F900618676 /* DVDCodecUtils.cpp */; }; - E38E1F850D25F9FD00618676 /* DVDFactoryCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E15240D25F9F900618676 /* DVDFactoryCodec.cpp */; }; - E38E1F870D25F9FD00618676 /* DVDOverlayCodecCC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E152B0D25F9F900618676 /* DVDOverlayCodecCC.cpp */; }; -@@ -2731,9 +2727,7 @@ - E49911BE174E5D0A00741B6D /* LibraryLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E14ED0D25F9F900618676 /* LibraryLoader.cpp */; }; - E49911BF174E5D0A00741B6D /* SoLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E14F40D25F9F900618676 /* SoLoader.cpp */; }; - E49911C0174E5D2500741B6D /* DVDAudioCodecFFmpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E15070D25F9F900618676 /* DVDAudioCodecFFmpeg.cpp */; }; -- E49911C2174E5D2500741B6D /* DVDAudioCodecLPcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E15110D25F9F900618676 /* DVDAudioCodecLPcm.cpp */; }; - E49911C3174E5D2500741B6D /* DVDAudioCodecPassthrough.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB6610615374E80006B8FF1 /* DVDAudioCodecPassthrough.cpp */; }; -- E49911C5174E5D2500741B6D /* DVDAudioCodecPcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E15150D25F9F900618676 /* DVDAudioCodecPcm.cpp */; }; - E49911C6174E5D2500741B6D /* DVDOverlayCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFDA3152160E34230047A626 /* DVDOverlayCodec.cpp */; }; - E49911C7174E5D2500741B6D /* DVDOverlayCodecCC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E152B0D25F9F900618676 /* DVDOverlayCodecCC.cpp */; }; - E49911C8174E5D2500741B6D /* DVDOverlayCodecFFmpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E152D0D25F9F900618676 /* DVDOverlayCodecFFmpeg.cpp */; }; -@@ -5224,10 +5218,6 @@ - E38E15060D25F9F900618676 /* DVDAudioCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVDAudioCodec.h; sourceTree = ""; }; - E38E15070D25F9F900618676 /* DVDAudioCodecFFmpeg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDAudioCodecFFmpeg.cpp; sourceTree = ""; }; - E38E15080D25F9F900618676 /* DVDAudioCodecFFmpeg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVDAudioCodecFFmpeg.h; sourceTree = ""; }; -- E38E15110D25F9F900618676 /* DVDAudioCodecLPcm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDAudioCodecLPcm.cpp; sourceTree = ""; }; -- E38E15120D25F9F900618676 /* DVDAudioCodecLPcm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVDAudioCodecLPcm.h; sourceTree = ""; }; -- E38E15150D25F9F900618676 /* DVDAudioCodecPcm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDAudioCodecPcm.cpp; sourceTree = ""; }; -- E38E15160D25F9F900618676 /* DVDAudioCodecPcm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVDAudioCodecPcm.h; sourceTree = ""; }; - E38E15210D25F9F900618676 /* DVDCodecs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVDCodecs.h; sourceTree = ""; }; - E38E15220D25F9F900618676 /* DVDCodecUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDCodecUtils.cpp; sourceTree = ""; }; - E38E15230D25F9F900618676 /* DVDCodecUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVDCodecUtils.h; sourceTree = ""; }; -@@ -8849,12 +8839,8 @@ - E38E15060D25F9F900618676 /* DVDAudioCodec.h */, - E38E15070D25F9F900618676 /* DVDAudioCodecFFmpeg.cpp */, - E38E15080D25F9F900618676 /* DVDAudioCodecFFmpeg.h */, -- E38E15110D25F9F900618676 /* DVDAudioCodecLPcm.cpp */, -- E38E15120D25F9F900618676 /* DVDAudioCodecLPcm.h */, - DFB6610615374E80006B8FF1 /* DVDAudioCodecPassthrough.cpp */, - DFB6610715374E80006B8FF1 /* DVDAudioCodecPassthrough.h */, -- E38E15150D25F9F900618676 /* DVDAudioCodecPcm.cpp */, -- E38E15160D25F9F900618676 /* DVDAudioCodecPcm.h */, - ); - path = Audio; - sourceTree = ""; -@@ -10703,8 +10689,6 @@ - E38E1F790D25F9FD00618676 /* DVDAudio.cpp in Sources */, - E38E1F7A0D25F9FD00618676 /* DVDClock.cpp in Sources */, - E38E1F7B0D25F9FD00618676 /* DVDAudioCodecFFmpeg.cpp in Sources */, -- E38E1F800D25F9FD00618676 /* DVDAudioCodecLPcm.cpp in Sources */, -- E38E1F820D25F9FD00618676 /* DVDAudioCodecPcm.cpp in Sources */, - E38E1F840D25F9FD00618676 /* DVDCodecUtils.cpp in Sources */, - E38E1F850D25F9FD00618676 /* DVDFactoryCodec.cpp in Sources */, - E38E1F870D25F9FD00618676 /* DVDOverlayCodecCC.cpp in Sources */, -@@ -11975,9 +11959,7 @@ - DFF0F15617528350002DA3A4 /* LibraryLoader.cpp in Sources */, - DFF0F15717528350002DA3A4 /* SoLoader.cpp in Sources */, - DFF0F15817528350002DA3A4 /* DVDAudioCodecFFmpeg.cpp in Sources */, -- DFF0F15A17528350002DA3A4 /* DVDAudioCodecLPcm.cpp in Sources */, - DFF0F15B17528350002DA3A4 /* DVDAudioCodecPassthrough.cpp in Sources */, -- DFF0F15D17528350002DA3A4 /* DVDAudioCodecPcm.cpp in Sources */, - DFF0F15E17528350002DA3A4 /* DVDOverlayCodec.cpp in Sources */, - DFF0F15F17528350002DA3A4 /* DVDOverlayCodecCC.cpp in Sources */, - DFF0F16017528350002DA3A4 /* DVDOverlayCodecFFmpeg.cpp in Sources */, -@@ -13178,9 +13160,7 @@ - E49911BE174E5D0A00741B6D /* LibraryLoader.cpp in Sources */, - E49911BF174E5D0A00741B6D /* SoLoader.cpp in Sources */, - E49911C0174E5D2500741B6D /* DVDAudioCodecFFmpeg.cpp in Sources */, -- E49911C2174E5D2500741B6D /* DVDAudioCodecLPcm.cpp in Sources */, - E49911C3174E5D2500741B6D /* DVDAudioCodecPassthrough.cpp in Sources */, -- E49911C5174E5D2500741B6D /* DVDAudioCodecPcm.cpp in Sources */, - E49911C6174E5D2500741B6D /* DVDOverlayCodec.cpp in Sources */, - E49911C7174E5D2500741B6D /* DVDOverlayCodecCC.cpp in Sources */, - E49911C8174E5D2500741B6D /* DVDOverlayCodecFFmpeg.cpp in Sources */, --- -1.9.3 - - -From bc6e4aef06c56bb8dd0f80fb12acf751b5e5f49f Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sat, 7 Jun 2014 23:24:31 +0200 -Subject: [PATCH 08/35] VS Project - Adjust after removal codecs pcm/lpcm - ---- - project/VS2010Express/XBMC.vcxproj | 6 +----- - project/VS2010Express/XBMC.vcxproj.filters | 12 ------------ - 2 files changed, 1 insertion(+), 17 deletions(-) - -diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj -index 055722f..b0cc17e 100644 ---- a/project/VS2010Express/XBMC.vcxproj -+++ b/project/VS2010Express/XBMC.vcxproj -@@ -1461,8 +1461,6 @@ - - - -- -- - - - -@@ -2162,8 +2160,6 @@ - - - -- -- - - - -@@ -2541,4 +2537,4 @@ - - - -- -\ No newline at end of file -+ -diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters -index 2d2c5dc..7771bf4 100644 ---- a/project/VS2010Express/XBMC.vcxproj.filters -+++ b/project/VS2010Express/XBMC.vcxproj.filters -@@ -402,12 +402,6 @@ - - cores\dvdplayer\DVDCodecs\Audio - -- -- cores\dvdplayer\DVDCodecs\Audio -- -- -- cores\dvdplayer\DVDCodecs\Audio -- - - cores\dvdplayer\DVDCodecs\Video - -@@ -3172,12 +3166,6 @@ - - cores\dvdplayer\DVDCodecs\Audio - -- -- cores\dvdplayer\DVDCodecs\Audio -- -- -- cores\dvdplayer\DVDCodecs\Audio -- - - cores\dvdplayer\DVDCodecs\Video - --- -1.9.3 - - From 653f57ae1d9895d66a0a4a188607ae9f93db7022 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:34:39 +0200