av1parse: let the parse continue when MISSING_OBU_REFERENCE error.

Some streams may have verbose OBUs before a valid sequence header. We
should let the parse continue rather than return a error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1634>
This commit is contained in:
He Junyan 2022-02-04 17:12:15 +08:00
parent 348658dd0a
commit a7ca0b2079

View file

@ -1373,7 +1373,8 @@ gst_av1_parse_handle_obu_to_obu (GstBaseParse * parse,
g_assert (consumed <= map_info.size);
if (res == GST_AV1_PARSER_BITSTREAM_ERROR) {
if (res == GST_AV1_PARSER_BITSTREAM_ERROR ||
res == GST_AV1_PARSER_MISSING_OBU_REFERENCE) {
if (consumed) {
*skipsize = consumed;
} else {
@ -1487,7 +1488,8 @@ again:
break;
}
if (res == GST_AV1_PARSER_BITSTREAM_ERROR) {
if (res == GST_AV1_PARSER_BITSTREAM_ERROR ||
res == GST_AV1_PARSER_MISSING_OBU_REFERENCE) {
/* Discard the whole frame */
*skipsize = map_info.size;
GST_WARNING_OBJECT (parse, "Parse obu error, discard %d", *skipsize);
@ -1609,7 +1611,8 @@ again:
goto out;
}
if (res == GST_AV1_PARSER_BITSTREAM_ERROR) {
if (res == GST_AV1_PARSER_BITSTREAM_ERROR ||
res == GST_AV1_PARSER_MISSING_OBU_REFERENCE) {
*skipsize = map_info.size;
GST_WARNING_OBJECT (parse, "Parse obu error, discard whole buffer %d.",
*skipsize);