mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
h264parse: fix writing NALU prefix for byte-stream output format
Specifically, input may already be in byte-stream format, so sync bytes should not be misinterpreted as NALU size.
This commit is contained in:
parent
5cabe639ac
commit
7d2e248155
1 changed files with 3 additions and 0 deletions
|
@ -1474,6 +1474,9 @@ gst_h264_parse_write_nal_prefix (GstH264Parse * h264parse, GstBuffer * nal)
|
|||
nal = gst_buffer_make_writable (nal);
|
||||
while (offset + 4 <= GST_BUFFER_SIZE (nal)) {
|
||||
nalu_size = GST_READ_UINT32_BE (GST_BUFFER_DATA (nal) + offset);
|
||||
/* input may already be in byte-stream */
|
||||
if (nalu_size == 1)
|
||||
break;
|
||||
GST_WRITE_UINT32_BE (GST_BUFFER_DATA (nal) + offset, 0x01);
|
||||
offset += nalu_size + 4;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue