pbutils: descriptions: Don't warn on MPEG-1 audio caps without layer field

While this is not ideal and won't give too accurate codec descriptions,
it is what tsdemux produces.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6511>
This commit is contained in:
Sebastian Dröge 2024-04-02 16:53:26 +03:00 committed by GStreamer Marge Bot
parent a780b9ed13
commit 4b5a265571

View file

@ -742,16 +742,17 @@ format_info_get_desc (const FormatInfo * info, const GstCaps * caps)
switch (ver) { switch (ver) {
case 1: case 1:
gst_structure_get_int (s, "layer", &layer); if (gst_structure_get_int (s, "layer", &layer)) {
switch (layer) { switch (layer) {
case 1: case 1:
case 2: case 2:
case 3: case 3:
return g_strdup_printf ("MPEG-1 Layer %d (MP%d)", layer, layer); return g_strdup_printf ("MPEG-1 Layer %d (MP%d)", layer, layer);
default: default:
break; break;
}
GST_WARNING ("Unexpected MPEG-1 layer in %" GST_PTR_FORMAT, caps);
} }
GST_WARNING ("Unexpected MPEG-1 layer in %" GST_PTR_FORMAT, caps);
return g_strdup ("MPEG-1 Audio"); return g_strdup ("MPEG-1 Audio");
case 2: case 2:
return g_strdup ("MPEG-2 AAC"); return g_strdup ("MPEG-2 AAC");