mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1057612 - Tell Apple AAC decoder about seeks. r=cpearce
According to the documentation we should set this flag to mark data discontinuities after seeking.
This commit is contained in:
parent
df9ac5b045
commit
c143f98cab
@ -35,6 +35,7 @@ AppleATDecoder::AppleATDecoder(const mp4_demuxer::AudioDecoderConfig& aConfig,
|
||||
, mCurrentAudioTimestamp(0)
|
||||
, mSamplePosition(0)
|
||||
, mHaveOutput(false)
|
||||
, mFlushed(false)
|
||||
{
|
||||
MOZ_COUNT_CTOR(AppleATDecoder);
|
||||
LOG("Creating Apple AudioToolbox Audio decoder");
|
||||
@ -135,6 +136,9 @@ AppleATDecoder::Flush()
|
||||
LOG("Error %d resetting AudioConverter", rv);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
// Notify our task queue of the coming input discontinuity.
|
||||
mTaskQueue->Dispatch(
|
||||
NS_NewRunnableMethod(this, &AppleATDecoder::SignalFlush));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -353,10 +357,11 @@ AppleATDecoder::SubmitSample(nsAutoPtr<mp4_demuxer::MP4Sample> aSample)
|
||||
{
|
||||
mSamplePosition = aSample->byte_offset;
|
||||
mCurrentAudioTimestamp = aSample->composition_timestamp;
|
||||
uint32_t flags = mFlushed ? kAudioFileStreamParseFlag_Discontinuity : 0;
|
||||
OSStatus rv = AudioFileStreamParseBytes(mStream,
|
||||
aSample->size,
|
||||
aSample->data,
|
||||
0);
|
||||
flags);
|
||||
if (rv != noErr) {
|
||||
LOG("Error %d parsing audio data", rv);
|
||||
mCallback->Error();
|
||||
@ -370,4 +375,10 @@ AppleATDecoder::SubmitSample(nsAutoPtr<mp4_demuxer::MP4Sample> aSample)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AppleATDecoder::SignalFlush()
|
||||
{
|
||||
mFlushed = true;
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -52,11 +52,13 @@ private:
|
||||
Microseconds mCurrentAudioTimestamp;
|
||||
int64_t mSamplePosition;
|
||||
bool mHaveOutput;
|
||||
bool mFlushed;
|
||||
AudioStreamBasicDescription mOutputFormat;
|
||||
AudioFileTypeID mFileType;
|
||||
|
||||
void SetupDecoder();
|
||||
void SubmitSample(nsAutoPtr<mp4_demuxer::MP4Sample> aSample);
|
||||
void SignalFlush();
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
Loading…
Reference in New Issue
Block a user