driver/audiodec: get back old audio decoders code, use configure option ENABLE_FFMPEGDEC

to switch between old code and ffmpegdec


Origin commit data
------------------
Commit: 0cb07d75d9
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2013-12-15 (Sun, 15 Dec 2013)
This commit is contained in:
[CST] Focus
2013-12-15 14:31:39 +04:00
parent e86e6a4b23
commit 1264be559d
8 changed files with 177 additions and 85 deletions

View File

@@ -200,13 +200,13 @@ void CFfmpegDec::DeInit(void)
in = NULL;
}
CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, const CFile::FileType ft, int /*OutputFd*/, State* state, CAudioMetaData* _meta_data, time_t* time_played, unsigned int* secondsToSkip)
CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, CAudioMetaData* _meta_data, time_t* time_played, unsigned int* secondsToSkip)
{
in = _in;
RetCode Status=OK;
is_stream = fseek((FILE *)in, 0, SEEK_SET);
if (!SetMetaData((FILE *)in, ft, _meta_data, true)) {
if (!SetMetaData((FILE *)in, _meta_data, true)) {
DeInit();
Status=DATA_ERR;
return Status;
@@ -384,9 +384,9 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, const CFile::FileType ft, int /
return Status;
}
bool CFfmpegDec::GetMetaData(FILE *_in, const CFile::FileType ft, const bool /*nice*/, CAudioMetaData* m)
bool CFfmpegDec::GetMetaData(FILE *_in, const bool /*nice*/, CAudioMetaData* m)
{
return SetMetaData(_in, ft, m);
return SetMetaData(_in, m);
}
CFfmpegDec* CFfmpegDec::getInstance()
@@ -399,11 +399,11 @@ CFfmpegDec* CFfmpegDec::getInstance()
return FfmpegDec;
}
bool CFfmpegDec::SetMetaData(FILE *_in, CFile::FileType ft, CAudioMetaData* m, bool save_cover)
bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover)
{
if (!meta_data_valid)
{
if (!Init(_in, ft))
if (!Init(_in, (const CFile::FileType) m->type))
return false;
mutex.lock();