mirror of https://github.com/odrling/Aegisub
s/Audio/FFmpegSourceAudioProvider/, originally I was planning something different now we're moving all media-related code, also replace missing public identifier from the class decleration.
Originally committed to SVN as r5325.
This commit is contained in:
parent
c603c21b86
commit
185721837b
|
@ -35,7 +35,7 @@ namespace media {
|
||||||
/// @brief Constructor
|
/// @brief Constructor
|
||||||
/// @param filename
|
/// @param filename
|
||||||
///
|
///
|
||||||
Audio::Audio(std::string filename)
|
FFmpegSourceAudioProvider::FFmpegSourceAudioProvider(std::string filename)
|
||||||
: AudioSource(NULL)
|
: AudioSource(NULL)
|
||||||
, COMInited(false)
|
, COMInited(false)
|
||||||
{
|
{
|
||||||
|
@ -72,7 +72,7 @@ Audio::Audio(std::string filename)
|
||||||
/// @brief Load audio file
|
/// @brief Load audio file
|
||||||
/// @param filename
|
/// @param filename
|
||||||
///
|
///
|
||||||
void Audio::LoadAudio(std::string filename) {
|
void FFmpegSourceAudioProvider::LoadAudio(std::string filename) {
|
||||||
// wxString FileNameShort = wxFileName(filename).GetShortPath();
|
// wxString FileNameShort = wxFileName(filename).GetShortPath();
|
||||||
|
|
||||||
FFMS_Indexer *Indexer = FFMS_CreateIndexer(filename.c_str(), &ErrInfo);
|
FFMS_Indexer *Indexer = FFMS_CreateIndexer(filename.c_str(), &ErrInfo);
|
||||||
|
@ -195,13 +195,13 @@ void Audio::LoadAudio(std::string filename) {
|
||||||
|
|
||||||
/// @brief Destructor
|
/// @brief Destructor
|
||||||
///
|
///
|
||||||
Audio::~Audio() {
|
FFmpegSourceAudioProvider::~FFmpegSourceAudioProvider() {
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Clean up
|
/// @brief Clean up
|
||||||
///
|
///
|
||||||
void Audio::Close() {
|
void FFmpegSourceAudioProvider::Close() {
|
||||||
if (AudioSource) FFMS_DestroyAudioSource(AudioSource);
|
if (AudioSource) FFMS_DestroyAudioSource(AudioSource);
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
if (COMInited)
|
if (COMInited)
|
||||||
|
@ -214,7 +214,7 @@ void Audio::Close() {
|
||||||
/// @param Start
|
/// @param Start
|
||||||
/// @param Count
|
/// @param Count
|
||||||
///
|
///
|
||||||
void Audio::GetAudio(void *Buf, int64_t Start, int64_t Count) const {
|
void FFmpegSourceAudioProvider::GetAudio(void *Buf, int64_t Start, int64_t Count) const {
|
||||||
if (FFMS_GetAudio(AudioSource, Buf, Start, Count, &ErrInfo)) {
|
if (FFMS_GetAudio(AudioSource, Buf, Start, Count, &ErrInfo)) {
|
||||||
throw AudioDecodeError(std::string("Failed to get audio samples: ") + ErrInfo.Buffer);
|
throw AudioDecodeError(std::string("Failed to get audio samples: ") + ErrInfo.Buffer);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ namespace media {
|
||||||
|
|
||||||
/// @class Audio
|
/// @class Audio
|
||||||
/// Audio file support.
|
/// Audio file support.
|
||||||
class Audio : public AudioProvider, FFmpegSourceProvider {
|
class FFmpegSourceAudioProvider : public AudioProvider, FFmpegSourceProvider {
|
||||||
FFMS_AudioSource *AudioSource; ///< audio source object
|
FFMS_AudioSource *AudioSource; ///< audio source object
|
||||||
bool COMInited; ///< COM initialization state
|
bool COMInited; ///< COM initialization state
|
||||||
|
|
||||||
|
@ -45,8 +45,9 @@ class Audio : public AudioProvider, FFmpegSourceProvider {
|
||||||
void Close();
|
void Close();
|
||||||
void LoadAudio(std::string filename);
|
void LoadAudio(std::string filename);
|
||||||
|
|
||||||
Audio(std::string filename);
|
public:
|
||||||
virtual ~Audio();
|
FFmpegSourceAudioProvider(std::string filename);
|
||||||
|
virtual ~FFmpegSourceAudioProvider();
|
||||||
|
|
||||||
/// @brief Checks sample endianness
|
/// @brief Checks sample endianness
|
||||||
/// @return Returns true.
|
/// @return Returns true.
|
||||||
|
|
Loading…
Reference in New Issue