mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 05:59:10 +00:00
camutils: Fix PMT message construction
The size of the message ended up being bigger than its content. That cause some CA modules to just hang.
This commit is contained in:
parent
3d588134d8
commit
d049eadd50
1 changed files with 14 additions and 1 deletions
|
@ -253,6 +253,7 @@ cam_build_ca_pmt (GstStructure * pmt, guint8 list_management, guint8 cmd_id,
|
||||||
stream = g_value_get_boxed (value);
|
stream = g_value_get_boxed (value);
|
||||||
|
|
||||||
value = gst_structure_get_value (stream, "descriptors");
|
value = gst_structure_get_value (stream, "descriptors");
|
||||||
|
len = 0;
|
||||||
if (value != NULL) {
|
if (value != NULL) {
|
||||||
stream_descriptors = g_value_get_boxed (value);
|
stream_descriptors = g_value_get_boxed (value);
|
||||||
|
|
||||||
|
@ -267,16 +268,28 @@ cam_build_ca_pmt (GstStructure * pmt, guint8 list_management, guint8 cmd_id,
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GST_DEBUG ("Body Size %d", body_size);
|
||||||
|
|
||||||
buffer = g_malloc0 (body_size);
|
buffer = g_malloc0 (body_size);
|
||||||
body = buffer;
|
body = buffer;
|
||||||
|
|
||||||
|
/* ca_pmt_list_management 8 uimsbf */
|
||||||
*body++ = list_management;
|
*body++ = list_management;
|
||||||
|
|
||||||
|
/* program_number 16 uimsbf */
|
||||||
GST_WRITE_UINT16_BE (body, program_number);
|
GST_WRITE_UINT16_BE (body, program_number);
|
||||||
body += 2;
|
body += 2;
|
||||||
|
|
||||||
|
/* reserved 2
|
||||||
|
* version_number 5
|
||||||
|
* current_next_indicator 1
|
||||||
|
*/
|
||||||
*body++ = (version_number << 1) | 0x01;
|
*body++ = (version_number << 1) | 0x01;
|
||||||
|
|
||||||
|
/* Reserved 4
|
||||||
|
* program_info_length 12
|
||||||
|
*/
|
||||||
len = GPOINTER_TO_INT (lengths->data);
|
len = GPOINTER_TO_INT (lengths->data);
|
||||||
lengths = g_list_delete_link (lengths, lengths);
|
lengths = g_list_delete_link (lengths, lengths);
|
||||||
GST_WRITE_UINT16_BE (body, len);
|
GST_WRITE_UINT16_BE (body, len);
|
||||||
|
@ -298,7 +311,6 @@ cam_build_ca_pmt (GstStructure * pmt, guint8 list_management, guint8 cmd_id,
|
||||||
gst_structure_get_uint (stream, "stream-type", &stream_type);
|
gst_structure_get_uint (stream, "stream-type", &stream_type);
|
||||||
gst_structure_get_uint (stream, "pid", &stream_pid);
|
gst_structure_get_uint (stream, "pid", &stream_pid);
|
||||||
value = gst_structure_get_value (stream, "descriptors");
|
value = gst_structure_get_value (stream, "descriptors");
|
||||||
stream_descriptors = g_value_get_boxed (value);
|
|
||||||
|
|
||||||
*body++ = stream_type;
|
*body++ = stream_type;
|
||||||
GST_WRITE_UINT16_BE (body, stream_pid);
|
GST_WRITE_UINT16_BE (body, stream_pid);
|
||||||
|
@ -310,6 +322,7 @@ cam_build_ca_pmt (GstStructure * pmt, guint8 list_management, guint8 cmd_id,
|
||||||
|
|
||||||
if (len != 0) {
|
if (len != 0) {
|
||||||
*body++ = cmd_id;
|
*body++ = cmd_id;
|
||||||
|
stream_descriptors = g_value_get_boxed (value);
|
||||||
body = write_ca_descriptors (body, stream_descriptors);
|
body = write_ca_descriptors (body, stream_descriptors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue