mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
h264/h265parse: Fix handling of very last frame
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 commite88d848070
anda194a87b26
. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1275 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1208>
This commit is contained in:
parent
15365aba70
commit
0d637c14c5
2 changed files with 12 additions and 2 deletions
|
@ -1546,8 +1546,13 @@ gst_h264_parse_handle_frame (GstBaseParse * parse,
|
|||
/* 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:
|
||||
|
|
|
@ -1341,8 +1341,13 @@ gst_h265_parse_handle_frame (GstBaseParse * parse,
|
|||
/* 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:
|
||||
|
|
Loading…
Reference in a new issue