Print Error Message for Bad AVC Profile - #106
Conversation
|
I'm not sure this test belongs here. Parsing may fail e.g. with truncated boxes. I'm ok to stop parsing with some exception - and why not find a mecanism to display the message from the exception. What do you think? PS: typo: AVCProfileIndiciation should be AVCProfileIndication |
|
I originally changed } catch(...) {
fprintf(stderr, "Failed to parse box: '%s'\n", toString(subReader.myBox.fourcc).c_str());
exit(1);
}to } catch(const std::exception &e) {
fprintf(stderr, "%s\n", e.what());
fprintf(stderr, "Failed to parse box: '%s'\n", toString(subReader.myBox.fourcc).c_str());
exit(1);
}But this changed the output for many .ref test files, so running |
|
Changing a lot of .ref files is not an issue. But I feel the rationale for this change is something else: an ISOBMFF box is truncated and CW keeps on processing without any warning. Is that correct? If so, we could evaluate a bunch of options:
What do you think? |
No, the bit reader immediately throws an error: if(AVCProfileIndication != 66 && AVCProfileIndication != 77 && AVCProfileIndication != 88) {
br->sym("reserved9", 6); // Throws Error!
ENSURE(byteOffset < size, "BitReader::bit() overflow");The CW stops processing and prints: Sample File: bad-avcC.box |
A common error for the
avcCbox is providing profile values despiteAVCProfileIndicationvariable saying there shouldn't be.This PR prints an additional message informing the user of the issue.