From ed49373e87db17f67c1d9032132cca17efe16fee Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 30 Apr 2018 17:17:22 +0200 Subject: [PATCH] pbutils: Avoid assertion describing raw audio caps without format We used to get: gst_audio_format_from_string: assertion 'format != NULL' failed --- gst-libs/gst/pbutils/descriptions.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/pbutils/descriptions.c b/gst-libs/gst/pbutils/descriptions.c index 97894c7aa2..8b633352a3 100644 --- a/gst-libs/gst/pbutils/descriptions.c +++ b/gst-libs/gst/pbutils/descriptions.c @@ -821,11 +821,12 @@ format_info_get_desc (const FormatInfo * info, const GstCaps * caps) gint depth = 0; gboolean is_float; const gchar *str; - GstAudioFormat format; + GstAudioFormat format = GST_AUDIO_FORMAT_UNKNOWN; const GstAudioFormatInfo *finfo; str = gst_structure_get_string (s, "format"); - format = gst_audio_format_from_string (str); + if (str) + format = gst_audio_format_from_string (str); if (format == GST_AUDIO_FORMAT_UNKNOWN) return g_strdup (_("Uncompressed audio"));