Bug 1066369 - Return error instead of asserting. r=kinetik

From c2a87a986f6d0ed699ab0fbf5687d8aa5fea8ff0 Mon Sep 17 00:00:00 2001
NS_ASSERTION is debug-only, and fails silently in continuous
integration. Better to return an error here, since failure
could result in a crash later.
This commit is contained in:
Ralph Giles 2014-09-12 11:24:30 -07:00
parent 0fb73ac0d2
commit c6c5d7e6e7

View File

@ -224,16 +224,25 @@ AppleVTDecoder::SubmitFrame(mp4_demuxer::MP4Sample* aSample)
,aSample->size
,false
,block.receive());
NS_ASSERTION(rv == noErr, "Couldn't create CMBlockBuffer");
if (rv != noErr) {
NS_ERROR("Couldn't create CMBlockBuffer");
return NS_ERROR_FAILURE;
}
CMSampleTimingInfo timestamp = TimingInfoFromSample(aSample);
rv = CMSampleBufferCreate(kCFAllocatorDefault, block, true, 0, 0, mFormat, 1, 1, &timestamp, 0, NULL, sample.receive());
NS_ASSERTION(rv == noErr, "Couldn't create CMSampleBuffer");
if (rv != noErr) {
NS_ERROR("Couldn't create CMSampleBuffer");
return NS_ERROR_FAILURE;
}
rv = VTDecompressionSessionDecodeFrame(mSession,
sample,
0,
CreateAppleFrameRef(aSample),
&flags);
NS_ASSERTION(rv == noErr, "Couldn't pass frame to decoder");
if (rv != noErr) {
NS_ERROR("Couldn't pass frame to decoder");
return NS_ERROR_FAILURE;
}
// Ask for more data.
if (mTaskQueue->IsEmpty()) {