diff --git a/gst/mpegdemux/gstmpegtsdemux.c b/gst/mpegdemux/gstmpegtsdemux.c
index b3b8249..bd013f7 100644
--- a/gst/mpegdemux/gstmpegtsdemux.c
+++ b/gst/mpegdemux/gstmpegtsdemux.c
@@ -1160,7 +1160,7 @@ gst_mpegts_demux_data_cb (GstPESFilter * filter, gboolean first,
     /* fill in the last bits of the stream */
     /* if no stream type, then assume it based on the PES start code, 
      * needed for partial ts streams without PMT */
-    if (G_UNLIKELY (stream->flags & MPEGTS_STREAM_FLAG_STREAM_TYPE_UNKNOWN)) {
+    if (demux->nb_elementary_pids == 0 && G_LIKELY (stream->flags & MPEGTS_STREAM_FLAG_STREAM_TYPE_UNKNOWN)) {
       if ((filter->start_code & 0xFFFFFFF0) == PACKET_VIDEO_START_CODE) {
         /* it is mpeg2 video */
         stream->stream_type = ST_VIDEO_MPEG2;
@@ -1437,8 +1437,11 @@ gst_mpegts_stream_parse_pmt (GstMpegTSStream * stream,
 
     /* get/create elementary stream */
     ES_stream = gst_mpegts_demux_get_stream_for_PID (demux, entry.PID);
+
+    ES_stream->stream_type = stream_type;
+
     /* check if PID unknown */
-    if (ES_stream->PID_type == PID_TYPE_UNKNOWN) {
+    if (demux->nb_elementary_pids == 0 && ES_stream->PID_type == PID_TYPE_UNKNOWN) {
       /* set as elementary */
       ES_stream->PID_type = PID_TYPE_ELEMENTARY;
       /* set stream type */
