1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-06 11:42:17 +01:00

Add seek support to OD-based FFmpeg import.

Also some minor refactoring.
This feature works with mp3 right now - may work on other formats, but that will be a seperate commit.
It is not enabled so most of the changes won't even be compiled, and those that do won't be run.
To enable it uncommment the EXPERIMENTAL_ODFFMPEG def in Experimental.h
This commit is contained in:
mchinen
2010-07-05 14:38:47 +00:00
parent 4d244e93ae
commit 5a5957b422
9 changed files with 262 additions and 136 deletions

View File

@@ -311,28 +311,29 @@ bool ODDecodeBlockFile::IsDataAvailable()
/// Write the summary to disk, using the derived ReadData() to get the data
/// Here, the decoder ODTask associated with this file must fetch the samples with
/// the ODDecodeTask::Decode() method.
void ODDecodeBlockFile::WriteODDecodeBlockFile()
int ODDecodeBlockFile::WriteODDecodeBlockFile()
{
// To build the summary data, call ReadData (implemented by the
// derived classes) to get the sample data
samplePtr sampleData;// = NewSamples(mLen, floatSample);
int ret;
//use the decoder here.
mDecoderMutex.Lock();
if(!mDecoder)
{
mDecoderMutex.Unlock();
return;
return -1;
}
//sampleData and mFormat are set by the decoder.
mDecoder->Decode(sampleData, mFormat, mAliasStart, mLen, mAliasChannel);
ret = mDecoder->Decode(sampleData, mFormat, mAliasStart, mLen, mAliasChannel);
mDecoderMutex.Unlock();
if(ret < 0)
return ret; //failure
//the summary is also calculated here.
mFileNameMutex.Lock();
@@ -352,6 +353,8 @@ void ODDecodeBlockFile::WriteODDecodeBlockFile()
mDataAvailableMutex.Lock();
mDataAvailable=true;
mDataAvailableMutex.Unlock();
return ret;
}
///sets the file name the summary info will be saved in. threadsafe.