pbutils: Simplify h264_caps_structure_get_profile_flags_level a bit

Refactoring, removing one level of indentation from the function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1505>
This commit is contained in:
Philippe Normand 2022-01-09 09:39:32 +00:00 committed by GStreamer Marge Bot
parent 074c5d85cb
commit 6a3f2f0ba6

View File

@ -2270,15 +2270,15 @@ h264_caps_structure_get_profile_flags_level (GstStructure * caps_st,
GstBuffer *codec_data = NULL; GstBuffer *codec_data = NULL;
GstMapInfo map; GstMapInfo map;
gboolean ret = FALSE; gboolean ret = FALSE;
guint8 *data = NULL;
gsize size;
codec_data_value = gst_structure_get_value (caps_st, "codec_data"); codec_data_value = gst_structure_get_value (caps_st, "codec_data");
if (!codec_data_value) { if (!codec_data_value) {
GST_DEBUG GST_DEBUG
("video/x-h264 pad did not have codec_data set, cannot parse profile, flags and level"); ("video/x-h264 caps did not have codec_data set, cannot parse profile, flags and level");
return FALSE; return FALSE;
} else { }
guint8 *data = NULL;
gsize size;
codec_data = gst_value_get_buffer (codec_data_value); codec_data = gst_value_get_buffer (codec_data_value);
if (!gst_buffer_map (codec_data, &map, GST_MAP_READ)) { if (!gst_buffer_map (codec_data, &map, GST_MAP_READ)) {
@ -2293,7 +2293,6 @@ h264_caps_structure_get_profile_flags_level (GstStructure * caps_st,
("Failed to parse profile, flags and level from h264 codec data"); ("Failed to parse profile, flags and level from h264 codec data");
goto done; goto done;
} }
}
ret = TRUE; ret = TRUE;