mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
bitwriter: Fix a nal conversion bug when input is not byte aligned.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3193>
This commit is contained in:
parent
13be7cbe86
commit
9dc76185fc
2 changed files with 8 additions and 4 deletions
|
@ -1600,8 +1600,10 @@ gst_h264_bit_writer_convert_to_nal (guint nal_prefix_size, gboolean packetized,
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (raw_size % 8) {
|
if (raw_size % 8) {
|
||||||
if (!nal_writer_put_bits_uint8 (&nw, *(raw_data + raw_size / 8),
|
guint8 data = *(raw_data + raw_size / 8);
|
||||||
raw_size % 8))
|
|
||||||
|
if (!nal_writer_put_bits_uint8 (&nw,
|
||||||
|
data >> (8 - raw_size % 8), raw_size % 8))
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2267,8 +2267,10 @@ gst_h265_bit_writer_convert_to_nal (guint nal_prefix_size,
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (raw_size % 8) {
|
if (raw_size % 8) {
|
||||||
if (!nal_writer_put_bits_uint8 (&nw, *(raw_data + raw_size / 8),
|
guint8 data = *(raw_data + raw_size / 8);
|
||||||
raw_size % 8))
|
|
||||||
|
if (!nal_writer_put_bits_uint8 (&nw,
|
||||||
|
data >> (8 - raw_size % 8), raw_size % 8))
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue