diff options
author | Zaheer Abbas Merali <zaheer@localhost.localdomain> | 2009-04-10 19:06:55 +0200 |
---|---|---|
committer | Zaheer Abbas Merali <zaheer@localhost.localdomain> | 2009-04-21 12:09:31 +0100 |
commit | c5825f9e1d7430d75fc716b08f077d1a071519f7 (patch) | |
tree | a1cebb47a78fef1281fddab14bb494c42991188f | |
parent | 39d6074539c9e4ad9502923071d34d2d203436ea (diff) | |
download | gst-plugins-bad-c5825f9e1d7430d75fc716b08f077d1a071519f7.tar.gz gst-plugins-bad-c5825f9e1d7430d75fc716b08f077d1a071519f7.tar.bz2 gst-plugins-bad-c5825f9e1d7430d75fc716b08f077d1a071519f7.zip |
mpegtsparse: detect AC3 streams in PMT table
add 'has-ac3' boolean to pmt bus message
-rw-r--r-- | gst/mpegdemux/mpegtspacketizer.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gst/mpegdemux/mpegtspacketizer.c b/gst/mpegdemux/mpegtspacketizer.c index 923283d7..1abbf1fe 100644 --- a/gst/mpegdemux/mpegtspacketizer.c +++ b/gst/mpegdemux/mpegtspacketizer.c @@ -502,6 +502,17 @@ mpegts_packetizer_parse_pmt (MpegTSPacketizer * packetizer, g_free (struct_name); if (stream_info_length) { + /* check for AC3 descriptor */ + GstMPEGDescriptor *desc = + gst_mpeg_descriptor_parse (data, stream_info_length); + if (desc != NULL) { + if (gst_mpeg_descriptor_find (desc, DESC_DVB_AC3)) { + gst_structure_set (stream_info, "has-ac3", G_TYPE_BOOLEAN, TRUE, + NULL); + } + gst_mpeg_descriptor_free (desc); + } + descriptors = g_value_array_new (0); if (!mpegts_packetizer_parse_descriptors (packetizer, &data, data + stream_info_length, descriptors)) { @@ -514,6 +525,7 @@ mpegts_packetizer_parse_pmt (MpegTSPacketizer * packetizer, gst_structure_set (stream_info, "descriptors", G_TYPE_VALUE_ARRAY, descriptors, NULL); g_value_array_free (descriptors); + } g_value_init (&stream_value, GST_TYPE_STRUCTURE); |