Baseparse will never call us back on draining, so going into more: label will
cause the current frame to be discarded. So if we have a complete NAL, but not
a complete AU, make sure to terminate the frame properly.
This is a gression introduce by commit
e88d8480709581a2e54b7954c47193b729b23c79 and
a194a87b2600a21f1b47b8c89b1c930d5f30de42.
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1275
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1208>
/* expect at least 3 bytes start_code, and 1 bytes NALU header.
* the length of the NALU payload can be zero.
* (e.g. EOS/EOB placed at the end of an AU.) */
- if (size - current_off < 4)
+ if (size - current_off < 4) {
+ /* Finish the frame if there is no more data in the stream */
+ if (drain)
+ break;
+
goto more;
+ }
}
end:
/* expect at least 3 bytes start_code, and 2 bytes NALU header.
* the length of the NALU payload can be zero.
* (e.g. EOS/EOB placed at the end of an AU.) */
- if (G_UNLIKELY (size - current_off < 5))
+ if (G_UNLIKELY (size - current_off < 5)) {
+ /* Finish the frame if there is no more data in the stream */
+ if (drain)
+ break;
+
goto more;
+ }
}
end: