Skip to content

Commit

Permalink
AudioDecoder.h: avoid include of ICodec and AEChannelInfo.h
Browse files Browse the repository at this point in the history
  • Loading branch information
notspiff authored and akva2 committed Oct 11, 2022
1 parent a30c699 commit 954aba0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
14 changes: 14 additions & 0 deletions xbmc/cores/paplayer/AudioDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "CodecFactory.h"
#include "FileItem.h"
#include "ICodec.h"
#include "ServiceBroker.h"
#include "application/Application.h"
#include "music/tags/MusicInfoTag.h"
Expand Down Expand Up @@ -141,6 +142,11 @@ AEAudioFormat CAudioDecoder::GetFormat()
return m_codec->m_format;
}

unsigned int CAudioDecoder::GetChannels()
{
return GetFormat().m_channelLayout.Count();
}

int64_t CAudioDecoder::Seek(int64_t time)
{
m_pcmBuffer.Clear();
Expand Down Expand Up @@ -328,6 +334,14 @@ int CAudioDecoder::ReadSamples(int numsamples)
return RET_SLEEP; // nothing to do
}

bool CAudioDecoder::CanSeek()
{
if (m_codec)
return m_codec->CanSeek();
else
return false;
}

float CAudioDecoder::GetReplayGain(float &peakVal)
{
#define REPLAY_GAIN_DEFAULT_LEVEL 89.0f
Expand Down
14 changes: 4 additions & 10 deletions xbmc/cores/paplayer/AudioDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

#pragma once

#include "ICodec.h"
#include "cores/AudioEngine/Utils/AEChannelInfo.h"
#include "threads/CriticalSection.h"
#include "utils/RingBuffer.h"

struct AEAudioFormat;
class CFileItem;
class ICodec;

#define PACKET_SIZE 3840 // audio packet size - we keep 1 in reserve for gapless playback
// using a multiple of 1, 2, 3, 4, 5, 6 to guarantee track alignment
Expand Down Expand Up @@ -48,13 +48,7 @@ class CAudioDecoder

int ReadSamples(int numsamples);

bool CanSeek()
{
if (m_codec)
return m_codec->CanSeek();
else
return false;
}
bool CanSeek();
int64_t Seek(int64_t time);
int64_t TotalTime();
void SetTotalTime(int64_t time);
Expand All @@ -63,7 +57,7 @@ class CAudioDecoder
void SetStatus(int status) { m_status = status; }

AEAudioFormat GetFormat();
unsigned int GetChannels() { return GetFormat().m_channelLayout.Count(); }
unsigned int GetChannels();
// Data management
unsigned int GetDataSize(bool checkPktSize);
void *GetData(unsigned int samples);
Expand Down
2 changes: 2 additions & 0 deletions xbmc/cores/paplayer/PAPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#include "PAPlayer.h"

#include "FileItem.h"
#include "ICodec.h"
#include "ServiceBroker.h"
#include "URL.h"
#include "Util.h"
#include "cores/AudioEngine/Interfaces/AE.h"
#include "cores/AudioEngine/Interfaces/AEStream.h"
Expand Down
1 change: 1 addition & 0 deletions xbmc/cores/playercorefactory/PlayerCoreFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "cores/VideoPlayer/Interface/InputStreamConstants.h"
#include "cores/paplayer/PAPlayer.h"
#include "dialogs/GUIDialogContextMenu.h"
#include "filesystem/File.h"
#include "guilib/LocalizeStrings.h"
#include "profiles/ProfileManager.h"
#include "settings/AdvancedSettings.h"
Expand Down

0 comments on commit 954aba0

Please sign in to comment.