From f0f6bd4910e340cbaf00a23e8b17860b637ef960 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 18 Feb 2015 11:34:15 +0000 Subject: [PATCH] pbutils: description: fix MPEG-2 video profiles in description We would accidentally use the profile nick as profile name in the description for MPEG video that's not version 4. --- gst-libs/gst/pbutils/descriptions.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gst-libs/gst/pbutils/descriptions.c b/gst-libs/gst/pbutils/descriptions.c index 006b57a..dc4b4fc 100644 --- a/gst-libs/gst/pbutils/descriptions.c +++ b/gst-libs/gst/pbutils/descriptions.c @@ -349,6 +349,14 @@ pbutils_desc_get_profile_name_from_nick (const gchar * map, gsize map_len, } static const gchar * +pbutils_desc_get_mpeg2v_profile_name_from_nick (const gchar * nick) +{ + const gchar map[] = "simple\000Simple\000main\000Main\000high\000High\000"; + + return pbutils_desc_get_profile_name_from_nick (map, sizeof (map), nick); +} + +static const gchar * pbutils_desc_get_mpeg4v_profile_name_from_nick (const gchar * nick) { const gchar map[] = "simple\000Simple\000" @@ -792,6 +800,10 @@ format_info_get_desc (const FormatInfo * info, const GstCaps * caps) if (profile != NULL) { if (ver == 4) profile = pbutils_desc_get_mpeg4v_profile_name_from_nick (profile); + else if (ver == 2) + profile = pbutils_desc_get_mpeg2v_profile_name_from_nick (profile); + else + profile = NULL; } if (profile != NULL) return g_strdup_printf ("MPEG-%d Video (%s Profile)", ver, profile); -- 2.7.4