diff --git a/gst/mpegdemux/mpegtspacketizer.c b/gst/mpegdemux/mpegtspacketizer.c index 58e379af63..284868e550 100644 --- a/gst/mpegdemux/mpegtspacketizer.c +++ b/gst/mpegdemux/mpegtspacketizer.c @@ -1994,8 +1994,15 @@ mpegts_try_discover_packet_size (MpegTSPacketizer * packetizer) if (dest[i] == 0x47 && dest[i + packetsize] == 0x47 && dest[i + packetsize * 2] == 0x47 && dest[i + packetsize * 3] == 0x47) { + gchar *str; packetizer->know_packet_size = TRUE; packetizer->packet_size = packetsize; + str = + g_strdup_printf + ("video/mpegts, systemstream=(boolean)true, packetsize=%d", + packetsize); + packetizer->caps = gst_caps_from_string ((const gchar *) str); + g_free (str); pos = i; break; } diff --git a/gst/mpegdemux/mpegtspacketizer.h b/gst/mpegdemux/mpegtspacketizer.h index f30231ff27..7c7552a2e0 100644 --- a/gst/mpegdemux/mpegtspacketizer.h +++ b/gst/mpegdemux/mpegtspacketizer.h @@ -62,6 +62,7 @@ struct _MpegTSPacketizer { gboolean disposed; gboolean know_packet_size; guint16 packet_size; + GstCaps *caps; }; struct _MpegTSPacketizerClass { diff --git a/gst/mpegdemux/mpegtsparse.c b/gst/mpegdemux/mpegtsparse.c index dcadc01931..dab403dd14 100644 --- a/gst/mpegdemux/mpegtsparse.c +++ b/gst/mpegdemux/mpegtsparse.c @@ -773,15 +773,12 @@ mpegts_parse_push (MpegTSParse * parse, MpegTSPacketizerPacket * packet, guint16 pid; GstBuffer *buffer; GstFlowReturn ret; - GstCaps *caps; GList *srcpads; pid = packet->pid; buffer = packet->buffer; /* we have the same caps on all the src pads */ - caps = gst_static_pad_template_get_caps (&src_template); - gst_buffer_set_caps (buffer, caps); - gst_caps_unref (caps); + gst_buffer_set_caps (buffer, parse->packetizer->caps); GST_OBJECT_LOCK (parse); /* clear tspad->pushed on pads */