ogmparse: Make sure we set valid string on caps

the fourcc might not contain printable characters, use the convenience
macro to turn it into a printable fourcc, like it's done in
gstogmparse
This commit is contained in:
Edward Hervey 2017-12-06 14:22:49 +01:00 committed by Edward Hervey
parent 4b4f8d1a05
commit 427df2d5d9

View file

@ -572,10 +572,14 @@ gst_ogm_parse_stream_header (GstOgmParse * ogm, const guint8 * data, guint size)
caps = gst_riff_create_video_caps (fourcc, NULL, NULL, NULL, NULL, NULL);
if (caps == NULL) {
GST_WARNING_OBJECT (ogm, "could not find video caps for fourcc %"
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (fourcc));
caps = gst_caps_new_simple ("video/x-ogm-unknown", "fourcc",
G_TYPE_STRING, ogm->hdr.subtype, NULL);
gchar *fstr =
g_strdup_printf ("%" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (fourcc));
GST_WARNING_OBJECT (ogm, "could not find video caps for fourcc '%s'",
fstr);
caps =
gst_caps_new_simple ("video/x-ogm-unknown", "fourcc", G_TYPE_STRING,
fstr, NULL);
g_free (fstr);
break;
}