mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 09a51539cea1 (bug 881092) for breaking the build
This commit is contained in:
parent
b99212154a
commit
c0e1c28a90
@ -382,8 +382,7 @@ void* MediaDecoderReader::VideoQueueMemoryFunctor::operator()(void* anObject) {
|
||||
}
|
||||
|
||||
MediaDecoderReader::MediaDecoderReader(AbstractMediaDecoder* aDecoder)
|
||||
: mDecoder(aDecoder),
|
||||
mIgnoreAudioBackendFormat(false)
|
||||
: mDecoder(aDecoder)
|
||||
{
|
||||
MOZ_COUNT_CTOR(MediaDecoderReader);
|
||||
}
|
||||
|
@ -467,14 +467,6 @@ public:
|
||||
// decode thread could start up and run in future.
|
||||
virtual void OnDecodeThreadFinish() {}
|
||||
|
||||
// Tell the reader that the data decoded are not for direct playback, so it
|
||||
// can accept more files, in particular those which have more channels than
|
||||
// available in the audio output.
|
||||
void SetIgnoreAudioOutputFormat()
|
||||
{
|
||||
mIgnoreAudioOutputFormat = true;
|
||||
}
|
||||
|
||||
protected:
|
||||
// Queue of audio frames. This queue is threadsafe, and is accessed from
|
||||
// the audio, decoder, state machine, and main threads.
|
||||
@ -551,11 +543,6 @@ protected:
|
||||
|
||||
// Stores presentation info required for playback.
|
||||
VideoInfo mInfo;
|
||||
|
||||
// Whether we should accept media that we know we can't play
|
||||
// directly, because they have a number of channel higher than
|
||||
// what we support.
|
||||
bool mIgnoreAudioOutputFormat;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -61,8 +61,7 @@ static const uint16_t WAVE_FORMAT_CHUNK_SIZE = 16;
|
||||
// supported by AudioStream.
|
||||
static const uint16_t WAVE_FORMAT_ENCODING_PCM = 1;
|
||||
|
||||
// We reject files with more than this number of channels if we're decoding for
|
||||
// playback.
|
||||
// Maximum number of channels supported
|
||||
static const uint8_t MAX_CHANNELS = 2;
|
||||
|
||||
namespace {
|
||||
@ -431,14 +430,12 @@ WaveReader::LoadFormatChunk(uint32_t aChunkSize)
|
||||
|
||||
// Make sure metadata is fairly sane. The rate check is fairly arbitrary,
|
||||
// but the channels check is intentionally limited to mono or stereo
|
||||
// when the media is intended for direct playback because that's what the
|
||||
// audio backend currently supports.
|
||||
// because that's what the audio backend currently supports.
|
||||
unsigned int actualFrameSize = sampleFormat == 8 ? 1 : 2 * channels;
|
||||
if (rate < 100 || rate > 96000 ||
|
||||
(((channels < 1 || channels > MAX_CHANNELS) ||
|
||||
(frameSize != 1 && frameSize != 2 && frameSize != 4)) &&
|
||||
!mIgnoreAudioBackendFormat) ||
|
||||
(sampleFormat != 8 && sampleFormat != 16) ||
|
||||
channels < 1 || channels > MAX_CHANNELS ||
|
||||
(frameSize != 1 && frameSize != 2 && frameSize != 4) ||
|
||||
(sampleFormat != 8 && sampleFormat != 16) ||
|
||||
frameSize != actualFrameSize) {
|
||||
NS_WARNING("Invalid WAVE metadata");
|
||||
return false;
|
||||
|
@ -508,11 +508,6 @@ MediaDecodeTask::Decode()
|
||||
|
||||
mBufferDecoder->BeginDecoding(NS_GetCurrentThread());
|
||||
|
||||
// Tell the decoder reader that we are not going to play the data directly,
|
||||
// and that we should not reject files with more channels than the audio
|
||||
// bakend support.
|
||||
mDecoderReader->SetIgnoreAudioOutputFormat();
|
||||
|
||||
mDecoderReader->OnDecodeThreadStart();
|
||||
|
||||
VideoInfo videoInfo;
|
||||
|
Loading…
Reference in New Issue
Block a user