tsdemux: expose VC1 streams with missing descriptor.
authorJosep Torra <n770galaxy@gmail.com>
Tue, 5 Feb 2013 22:07:12 +0000 (23:07 +0100)
committerJosep Torra <n770galaxy@gmail.com>
Wed, 6 Feb 2013 12:58:07 +0000 (13:58 +0100)
Fixes playback of VC1 streams when the descriptor is missing.

gst/mpegtsdemux/tsdemux.c

index 0e9af64caa82bcac4a983649ec464b9f68c453c7..6375e99f126f9df2b96f3b008d9e2156365e4680 100644 (file)
@@ -849,23 +849,28 @@ create_pad_for_stream (MpegTSBase * base, MpegTSBaseStream * bstream,
       break;
     case ST_PRIVATE_EA:        /* Try to detect a VC1 stream */
     {
+      gboolean is_vc1 = FALSE;
       desc =
           mpegts_get_descriptor_from_stream ((MpegTSBaseStream *) stream,
           DESC_REGISTRATION);
       if (desc) {
         if (DESC_LENGTH (desc) >= 4) {
           if (DESC_REGISTRATION_format_identifier (desc) == DRF_ID_VC1) {
-            GST_WARNING ("0xea private stream type found but no descriptor "
-                "for VC1. Assuming plain VC1.");
-            template = gst_static_pad_template_get (&video_template);
-            name = g_strdup_printf ("video_%04x", bstream->pid);
-            caps = gst_caps_new_simple ("video/x-wmv",
-                "wmvversion", G_TYPE_INT, 3,
-                "format", G_TYPE_STRING, "WVC1", NULL);
+            is_vc1 = TRUE;
           }
         }
         g_free (desc);
       }
+      if (!is_vc1) {
+        GST_WARNING ("0xea private stream type found but no descriptor "
+            "for VC1. Assuming plain VC1.");
+      }
+
+      template = gst_static_pad_template_get (&video_template);
+      name = g_strdup_printf ("video_%04x", bstream->pid);
+      caps = gst_caps_new_simple ("video/x-wmv",
+          "wmvversion", G_TYPE_INT, 3, "format", G_TYPE_STRING, "WVC1", NULL);
+
       break;
     }
     case ST_BD_AUDIO_AC3: