mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
audio/video-info: Initialize the complete struct to 0 in the beginning
Instead of only initializing some parts in some code paths. Also makes it easier to use the reserved bits of the structs later. https://bugzilla.gnome.org/show_bug.cgi?id=720810
This commit is contained in:
parent
5f07c1ed4e
commit
65732d9c97
2 changed files with 4 additions and 4 deletions
|
@ -96,8 +96,6 @@ gst_audio_info_init (GstAudioInfo * info)
|
|||
memset (info, 0, sizeof (GstAudioInfo));
|
||||
|
||||
info->finfo = gst_audio_format_get_info (GST_AUDIO_FORMAT_UNKNOWN);
|
||||
|
||||
memset (&info->position, 0xff, sizeof (info->position));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -121,6 +119,8 @@ gst_audio_info_set_format (GstAudioInfo * info, GstAudioFormat format,
|
|||
g_return_if_fail (format != GST_AUDIO_FORMAT_UNKNOWN);
|
||||
g_return_if_fail (channels <= 64 || position == NULL);
|
||||
|
||||
memset (info, 0, sizeof (GstAudioInfo));
|
||||
|
||||
finfo = gst_audio_format_get_info (format);
|
||||
|
||||
info->flags = 0;
|
||||
|
@ -131,7 +131,6 @@ gst_audio_info_set_format (GstAudioInfo * info, GstAudioFormat format,
|
|||
info->bpf = (finfo->width * channels) / 8;
|
||||
|
||||
memset (&info->position, 0xff, sizeof (info->position));
|
||||
memset (&info->_gst_reserved, 0xff, sizeof (info->_gst_reserved));
|
||||
|
||||
if (!position && channels == 1) {
|
||||
info->position[0] = GST_AUDIO_CHANNEL_POSITION_MONO;
|
||||
|
|
|
@ -89,6 +89,8 @@ gst_video_info_set_format (GstVideoInfo * info, GstVideoFormat format,
|
|||
g_return_if_fail (info != NULL);
|
||||
g_return_if_fail (format != GST_VIDEO_FORMAT_UNKNOWN);
|
||||
|
||||
memset (info, 0, sizeof (GstVideoInfo));
|
||||
|
||||
finfo = gst_video_format_get_info (format);
|
||||
|
||||
info->flags = 0;
|
||||
|
@ -110,7 +112,6 @@ gst_video_info_set_format (GstVideoInfo * info, GstVideoFormat format,
|
|||
}
|
||||
|
||||
fill_planes (info);
|
||||
memset (&info->_gst_reserved, 0xff, sizeof (info->_gst_reserved));
|
||||
}
|
||||
|
||||
static const gchar *interlace_mode[] = {
|
||||
|
|
Loading…
Reference in a new issue