From 65732d9c97dd2091994c88167501e85de5e5755d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 30 Dec 2013 10:14:09 +0100 Subject: [PATCH] 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 --- gst-libs/gst/audio/audio-info.c | 5 ++--- gst-libs/gst/video/video-info.c | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/audio/audio-info.c b/gst-libs/gst/audio/audio-info.c index 53cdd5b..51bbac9 100644 --- a/gst-libs/gst/audio/audio-info.c +++ b/gst-libs/gst/audio/audio-info.c @@ -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; diff --git a/gst-libs/gst/video/video-info.c b/gst-libs/gst/video/video-info.c index 8140228..5a961d1 100644 --- a/gst-libs/gst/video/video-info.c +++ b/gst-libs/gst/video/video-info.c @@ -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[] = { -- 2.7.4