From c4140f9c258fcfe3003f20bac8ea50e6c97173c7 Mon Sep 17 00:00:00 2001 From: Arnaud Vrac Date: Fri, 2 Aug 2013 20:37:30 +0200 Subject: [PATCH] mpegdemux: send codec tag for each stream --- gst/mpegdemux/Makefile.am | 1 + gst/mpegdemux/gstmpegdemux.c | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gst/mpegdemux/Makefile.am b/gst/mpegdemux/Makefile.am index 41cdd89..5c23016 100644 --- a/gst/mpegdemux/Makefile.am +++ b/gst/mpegdemux/Makefile.am @@ -10,6 +10,7 @@ libgstmpegpsdemux_la_CFLAGS = \ $(GST_BASE_CFLAGS) $(GST_CFLAGS) libgstmpegpsdemux_la_LIBADD = \ $(GST_PLUGINS_BASE_LIBS) -lgsttag-$(GST_API_VERSION) \ + -lgstpbutils-$(GST_API_VERSION) \ $(GST_BASE_LIBS) $(GST_LIBS) libgstmpegpsdemux_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstmpegpsdemux_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) diff --git a/gst/mpegdemux/gstmpegdemux.c b/gst/mpegdemux/gstmpegdemux.c index 2384f6e..2b57d70 100644 --- a/gst/mpegdemux/gstmpegdemux.c +++ b/gst/mpegdemux/gstmpegdemux.c @@ -52,6 +52,9 @@ #include +#include +#include + #include "gstmpegdefs.h" #include "gstmpegdemux.h" @@ -495,6 +498,12 @@ gst_flups_demux_create_stream (GstFluPSDemux * demux, gint id, gint stream_type) g_free (stream_id); gst_pad_set_caps (stream->pad, caps); + + if (!stream->pending_tags) + stream->pending_tags = gst_tag_list_new_empty (); + gst_pb_utils_add_codec_description_to_tag_list (stream->pending_tags, NULL, + caps); + gst_caps_unref (caps); GST_DEBUG_OBJECT (demux, "create pad %s, caps %" GST_PTR_FORMAT, name, caps); g_free (name); @@ -788,8 +797,10 @@ gst_flups_demux_handle_dvd_event (GstFluPSDemux * demux, GstEvent * event) g_snprintf (cur_stream_name, 32, "audio-%d-language", i); lang_code = gst_structure_get_string (structure, cur_stream_name); if (lang_code) { - GstTagList *list = gst_tag_list_new_empty (); + GstTagList *list = temp->pending_tags; + if (!list) + list = gst_tag_list_new_empty (); gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, GST_TAG_LANGUAGE_CODE, lang_code, NULL); temp->pending_tags = list; @@ -820,8 +831,10 @@ gst_flups_demux_handle_dvd_event (GstFluPSDemux * demux, GstEvent * event) g_snprintf (cur_stream_name, 32, "subpicture-%d-language", i); lang_code = gst_structure_get_string (structure, cur_stream_name); if (lang_code) { - GstTagList *list = gst_tag_list_new_empty (); + GstTagList *list = temp->pending_tags; + if (!list) + list = gst_tag_list_new_empty (); gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, GST_TAG_LANGUAGE_CODE, lang_code, NULL); temp->pending_tags = list; -- 2.7.4