summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2021-08-18 11:14:37 -0400
committerTim-Philipp Müller <tim@centricular.com>2021-08-18 20:14:58 +0100
commitee7044efa72d713eca9a4282a9fe7fc03161568d (patch)
tree2f216480db188039b495c4f1a65af17b08ed6cf8
parenta2844f29d32a25462cf34d60ffc84fc45af5a8ac (diff)
v4l2slh264dec: Fix slice header bit size calculation
The emulation bytes need to be removed as bytes, not bit. This fixes decoding issues with files that have emulation bytes with the Cedrus driver. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2472>
-rw-r--r--sys/v4l2codecs/gstv4l2codech264dec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/v4l2codecs/gstv4l2codech264dec.c b/sys/v4l2codecs/gstv4l2codech264dec.c
index 85f31772b..4f40af413 100644
--- a/sys/v4l2codecs/gstv4l2codech264dec.c
+++ b/sys/v4l2codecs/gstv4l2codech264dec.c
@@ -488,8 +488,8 @@ gst_v4l2_codec_h264_dec_fill_decoder_params (GstV4l2CodecH264Dec * self,
static guint
get_slice_header_bit_size (GstH264Slice * slice)
{
- return 8 * slice->nalu.header_bytes
- + slice->header.header_size - slice->header.n_emulation_prevention_bytes;
+ return 8 * slice->nalu.header_bytes + slice->header.header_size
+ - 8 * slice->header.n_emulation_prevention_bytes;
}
static void