diff --git a/gst-libs/gst/mpegts/gst-dvb-descriptor.c b/gst-libs/gst/mpegts/gst-dvb-descriptor.c index 7a2332a293..2874e86d1a 100644 --- a/gst-libs/gst/mpegts/gst-dvb-descriptor.c +++ b/gst-libs/gst/mpegts/gst-dvb-descriptor.c @@ -1166,6 +1166,7 @@ gst_mpegts_descriptor_parse_dvb_parental_rating (const GstMpegTsDescriptor g_ptr_array_add (*rating, item); memcpy (item->country_code, data, 3); + item->country_code[3] = 0; data += 3; if (g_strcmp0 (item->country_code, "BRA") == 0) { diff --git a/tests/examples/mpegts/ts-parser.c b/tests/examples/mpegts/ts-parser.c index 00435c619a..86c53ee2f0 100644 --- a/tests/examples/mpegts/ts-parser.c +++ b/tests/examples/mpegts/ts-parser.c @@ -630,6 +630,23 @@ dump_descriptors (GPtrArray * descriptors, guint spacing) case GST_MTS_DESC_DVB_CONTENT: dump_content (desc, spacing + 2); break; + case GST_MTS_DESC_DVB_PARENTAL_RATING: + { + GPtrArray *ratings; + guint j; + + if (gst_mpegts_descriptor_parse_dvb_parental_rating (desc, &ratings)) { + for (j = 0; j < ratings->len; j++) { + GstMpegTsDVBParentalRatingItem *item = + g_ptr_array_index (ratings, j); + g_printf ("%*s country_code : %s\n", spacing, "", + item->country_code); + g_printf ("%*s rating age : %d\n", spacing, "", item->rating); + } + g_ptr_array_unref (ratings); + } + break; + } case GST_MTS_DESC_ISO_639_LANGUAGE: dump_iso_639_language (desc, spacing + 2); break;