From 374e756eee140218d018386d161bd03651ca3bc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 10 Apr 2014 12:30:50 +0100 Subject: [PATCH] pbutils: descriptions: default to systemstream=false for partial video/mpeg caps Assume systemstream=false for video/mpeg caps where that field is missing. --- gst-libs/gst/pbutils/descriptions.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/pbutils/descriptions.c b/gst-libs/gst/pbutils/descriptions.c index 6176ac74e6..fcb0f1b06d 100644 --- a/gst-libs/gst/pbutils/descriptions.c +++ b/gst-libs/gst/pbutils/descriptions.c @@ -664,16 +664,21 @@ format_info_get_desc (const FormatInfo * info, const GstCaps * caps) gboolean sysstream; gint ver = 0; - if (!gst_structure_get_boolean (s, "systemstream", &sysstream) || - !gst_structure_get_int (s, "mpegversion", &ver) || ver < 1 || ver > 4) { - GST_WARNING ("Missing fields in mpeg video caps %" GST_PTR_FORMAT, caps); - } else { + if (!gst_structure_get_boolean (s, "systemstream", &sysstream)) { + GST_WARNING ("Missing systemstream field in mpeg video caps " + "%" GST_PTR_FORMAT, caps); + sysstream = FALSE; + } + + if (gst_structure_get_int (s, "mpegversion", &ver) && ver > 0 && ver <= 4) { if (sysstream) { return g_strdup_printf ("MPEG-%d System Stream", ver); } else { return g_strdup_printf ("MPEG-%d Video", ver); } } + GST_WARNING ("Missing mpegversion field in mpeg video caps " + "%" GST_PTR_FORMAT, caps); return g_strdup ("MPEG Video"); } else if (strcmp (info->type, "audio/x-raw") == 0) { gint depth = 0;