mpegtsmux: add custom AC-3 descriptor
authorMathieu Duponchelle <mathieu@centricular.com>
Thu, 27 Sep 2018 15:15:20 +0000 (17:15 +0200)
committerMathieu Duponchelle <mathieu@centricular.com>
Thu, 27 Sep 2018 15:34:10 +0000 (17:34 +0200)
tsdemux expects a custom descriptor (GST_MTS_DESC_AC3_AUDIO_STREAM)
to detect a stream as AC3 and not EAC3.

Note that tsdemux expects this descriptor because mpegtsmux writes
a stream with a HDMV registration descriptor.

Fixes:

gst-launch-1.0 -v audiotestsrc ! avenc_ac3 ! ac3parse ! mpegtsmux ! \
tsdemux ! ac3parse ! avdec_ac3 ! audioconvert ! autoaudiosink

https://bugzilla.gnome.org/show_bug.cgi?id=797220

gst/mpegtsmux/tsmux/tsmuxstream.c

index 4cbd217..bd01c42 100644 (file)
@@ -974,7 +974,11 @@ tsmux_stream_get_es_descrs (TsMuxStream * stream,
 
       descriptor = gst_mpegts_descriptor_from_registration ("AC-3",
           add_info, 6);
+      g_ptr_array_add (pmt_stream->descriptors, descriptor);
 
+      descriptor =
+          gst_mpegts_descriptor_from_custom (GST_MTS_DESC_AC3_AUDIO_STREAM,
+          add_info, 6);
       g_ptr_array_add (pmt_stream->descriptors, descriptor);
 
       break;