зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1340129: P1. Allow empty raw frames. r=gerald
MozReview-Commit-ID: AU0QrahHtYe --HG-- extra : rebase_source : 34604298e01db1b7b481fc55c25cb5f23e806fa2
This commit is contained in:
Родитель
5e01f5beb4
Коммит
52e09e4b68
|
@ -112,7 +112,7 @@ WidevineVideoDecoder::Decode(GMPVideoEncodedFrame* aInputFrame,
|
|||
|
||||
RefPtr<MediaRawData> raw(
|
||||
new MediaRawData(aInputFrame->Buffer(), aInputFrame->Size()));
|
||||
if (!raw->Data()) {
|
||||
if (aInputFrame->Size() && !raw->Data()) {
|
||||
// OOM.
|
||||
mCallback->Error(GMPAllocErr);
|
||||
return;
|
||||
|
|
|
@ -128,7 +128,7 @@ VideoDecoderParent::RecvInput(const MediaRawDataIPDL& aData)
|
|||
// we'd just take ownership of the shmem.
|
||||
RefPtr<MediaRawData> data = new MediaRawData(aData.buffer().get<uint8_t>(),
|
||||
aData.buffer().Size<uint8_t>());
|
||||
if (!data->Data()) {
|
||||
if (aData.buffer().Size<uint8_t>() && !data->Data()) {
|
||||
// OOM
|
||||
Error(NS_ERROR_OUT_OF_MEMORY);
|
||||
return IPC_OK();
|
||||
|
|
|
@ -248,7 +248,7 @@ OggCodecState::PacketOutAsMediaRawData()
|
|||
!IsHeader(packet.get()),
|
||||
"PacketOutAsMediaRawData can only be called on non-header packets");
|
||||
RefPtr<MediaRawData> sample = new MediaRawData(packet->packet, packet->bytes);
|
||||
if (!sample->Data()) {
|
||||
if (packet->bytes && !sample->Data()) {
|
||||
// OOM.
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -702,13 +702,13 @@ WebMDemuxer::GetNextPacket(TrackInfo::TrackType aType,
|
|||
RefPtr<MediaRawData> sample;
|
||||
if (mInfo.mVideo.HasAlpha() && alphaLength != 0) {
|
||||
sample = new MediaRawData(data, length, alphaData, alphaLength);
|
||||
if (!sample->Data() || !sample->AlphaData()) {
|
||||
if ((length && !sample->Data()) || (alphaLength && !sample->AlphaData())) {
|
||||
// OOM.
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
sample = new MediaRawData(data, length);
|
||||
if (!sample->Data()) {
|
||||
if (length && !sample->Data()) {
|
||||
// OOM.
|
||||
return false;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче