summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ad45fd1)
raw | patch | inline | side by side (parent: ad45fd1)
author | Vittorio Palmisano <vpalmisano@gmail.com> | |
Tue, 16 Feb 2010 13:25:11 +0000 (13:25 +0000) | ||
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | |
Tue, 16 Feb 2010 13:33:10 +0000 (13:33 +0000) |
Fix off-by-one bug when constructing the avcC header chunk: we
wrote wrong profile info into the header. The first byte in the
SPS NAL we get from x264 is the nal type, not the profile_idc.
Also add some debug logging.
Fixes #610089.
wrote wrong profile info into the header. The first byte in the
SPS NAL we get from x264 is the nal type, not the profile_idc.
Also add some debug logging.
Fixes #610089.
ext/x264/gstx264enc.c | patch | blob | history |
diff --git a/ext/x264/gstx264enc.c b/ext/x264/gstx264enc.c
index d80e3bf821d8a4756314faba7548ae4847c87c31..7d545d514c68a994eb5476d992e0f303ecd839d1 100644 (file)
--- a/ext/x264/gstx264enc.c
+++ b/ext/x264/gstx264enc.c
return NULL;
}
+ GST_MEMDUMP ("SEI", nal[0].p_payload, nal[0].i_payload);
+ GST_MEMDUMP ("SPS", nal[1].p_payload, nal[1].i_payload);
+ GST_MEMDUMP ("PPS", nal[2].p_payload, nal[2].i_payload);
+
/* nal payloads with emulation_prevention_three_byte, and some header data */
buffer_size = (nal[1].i_payload + nal[2].i_payload) * 4 + 100;
buffer = g_malloc (buffer_size);
#endif
buffer[0] = 1; /* AVC Decoder Configuration Record ver. 1 */
- buffer[1] = sps[0]; /* profile_idc */
- buffer[2] = sps[1]; /* profile_compability */
- buffer[3] = sps[2]; /* level_idc */
+ buffer[1] = sps[1]; /* profile_idc */
+ buffer[2] = sps[2]; /* profile_compability */
+ buffer[3] = sps[3]; /* level_idc */
buffer[4] = 0xfc | (4 - 1); /* nal_length_size_minus1 */
i_size = 5;
memcpy (GST_BUFFER_DATA (buf), buffer, i_size);
g_free (buffer);
+ GST_MEMDUMP ("header", GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
+
return buf;
}