gst/mpegdemux/gstmpegdesc.c: Length should be a guint8 not a gint.

Original commit message from CVS:
patch by: Sebastian Pölsterl
* gst/mpegdemux/gstmpegdesc.c:
Length should be a guint8 not a gint.
* gst/mpegdemux/mpegtspacketizer.c:
Convert text to utf8 for each descriptor separately and not
concatenate them first and convert after.
This commit is contained in:
Sebastian Pölsterl 2008-11-05 18:11:55 +00:00 committed by Zaheer Abbas Merali
parent a5bf402c55
commit a65390d31a
3 changed files with 18 additions and 11 deletions

View file

@ -1,3 +1,13 @@
2008-11-05 Zaheer Abbas Merali <zaheerabbas at merali dot org>
patch by: Sebastian Pölsterl
* gst/mpegdemux/gstmpegdesc.c:
Length should be a guint8 not a gint.
* gst/mpegdemux/mpegtspacketizer.c:
Convert text to utf8 for each descriptor separately and not
concatenate them first and convert after.
2008-11-04 Stefan Kost <ensonic@users.sf.net> 2008-11-04 Stefan Kost <ensonic@users.sf.net>
* gst/modplug/gstmodplug.cc: * gst/modplug/gstmodplug.cc:

View file

@ -119,7 +119,7 @@ gst_mpeg_descriptor_n_desc (GstMPEGDescriptor * desc)
guint8 * guint8 *
gst_mpeg_descriptor_find (GstMPEGDescriptor * desc, gint tag) gst_mpeg_descriptor_find (GstMPEGDescriptor * desc, gint tag)
{ {
gint length; guint8 length;
guint8 *current; guint8 *current;
guint size; guint size;
@ -146,7 +146,7 @@ gst_mpeg_descriptor_find_all (GstMPEGDescriptor * desc, gint tag)
{ {
GArray *all; GArray *all;
gint length; guint8 length;
guint8 *current; guint8 *current;
guint size; guint size;
@ -165,13 +165,15 @@ gst_mpeg_descriptor_find_all (GstMPEGDescriptor * desc, gint tag)
length -= size; length -= size;
} }
GST_DEBUG ("found tag 0x%02x %d times", tag, all->len);
return all; return all;
} }
guint8 * guint8 *
gst_mpeg_descriptor_nth (GstMPEGDescriptor * desc, guint i) gst_mpeg_descriptor_nth (GstMPEGDescriptor * desc, guint i)
{ {
gint length; guint8 length;
guint8 *current; guint8 *current;
guint size; guint size;

View file

@ -1545,7 +1545,6 @@ mpegts_packetizer_parse_eit (MpegTSPacketizer * packetizer,
guint8 *extended_descriptor; guint8 *extended_descriptor;
/*GValue extended_items = { 0 }; */ /*GValue extended_items = { 0 }; */
gchar *extended_text = NULL; gchar *extended_text = NULL;
gchar *extended_text_tmp;
/*g_value_init (&extended_items, GST_TYPE_LIST); */ /*g_value_init (&extended_items, GST_TYPE_LIST); */
for (i = 0; i < extended_event_descriptors->len; i++) { for (i = 0; i < extended_event_descriptors->len; i++) {
extended_descriptor = g_array_index (extended_event_descriptors, extended_descriptor = g_array_index (extended_event_descriptors,
@ -1555,26 +1554,22 @@ mpegts_packetizer_parse_eit (MpegTSPacketizer * packetizer,
if (extended_text) { if (extended_text) {
gchar *tmp; gchar *tmp;
gchar *old_extended_text = extended_text; gchar *old_extended_text = extended_text;
tmp = g_strndup ((gchar *) tmp = get_encoding_and_convert ((gchar *)
DESC_DVB_EXTENDED_EVENT_text (extended_descriptor), DESC_DVB_EXTENDED_EVENT_text (extended_descriptor),
DESC_DVB_EXTENDED_EVENT_text_length (extended_descriptor)); DESC_DVB_EXTENDED_EVENT_text_length (extended_descriptor));
extended_text = g_strdup_printf ("%s%s", extended_text, tmp); extended_text = g_strdup_printf ("%s%s", extended_text, tmp);
g_free (old_extended_text); g_free (old_extended_text);
g_free (tmp); g_free (tmp);
} else { } else {
extended_text = g_strndup ((gchar *) extended_text = get_encoding_and_convert ((gchar *)
DESC_DVB_EXTENDED_EVENT_text (extended_descriptor), DESC_DVB_EXTENDED_EVENT_text (extended_descriptor),
DESC_DVB_EXTENDED_EVENT_text_length (extended_descriptor)); DESC_DVB_EXTENDED_EVENT_text_length (extended_descriptor));
} }
} }
} }
if (extended_text) { if (extended_text) {
extended_text_tmp = get_encoding_and_convert (extended_text,
strlen (extended_text));
gst_structure_set (event, "extended-text", G_TYPE_STRING, gst_structure_set (event, "extended-text", G_TYPE_STRING,
extended_text_tmp, NULL); extended_text, NULL);
g_free (extended_text_tmp);
g_free (extended_text); g_free (extended_text);
} }
g_array_free (extended_event_descriptors, TRUE); g_array_free (extended_event_descriptors, TRUE);