diff options
author | Diego Biurrun <diego@biurrun.de> | 2011-06-06 16:13:02 +0400 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2012-03-28 11:38:33 +0400 |
commit | a92be9b856bd11b081041c43c25d442028fe9a63 (patch) | |
tree | 32f852fdf904a30238c789e57510be710eaa7826 /libavformat/rtsp.c | |
parent | 856c8e0a049dc7069b7504d3aaa48549c75852de (diff) |
Replace memset(0) by zero initializations.
Also remove one pointless zero initialization in rangecoder.c.
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r-- | libavformat/rtsp.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 07cf80992e..fa761f54a8 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -157,8 +157,7 @@ static void rtsp_parse_range_npt(const char *p, int64_t *start, int64_t *end) static int get_sockaddr(const char *buf, struct sockaddr_storage *sock) { - struct addrinfo hints, *ai = NULL; - memset(&hints, 0, sizeof(hints)); + struct addrinfo hints = { 0 }, *ai = NULL; hints.ai_flags = AI_NUMERICHOST; if (getaddrinfo(buf, NULL, &hints, &ai)) return -1; @@ -497,9 +496,8 @@ int ff_sdp_parse(AVFormatContext *s, const char *content) * The Vorbis FMTP line can be up to 16KB - see xiph_parse_sdp_line * in rtpdec_xiph.c. */ char buf[16384], *q; - SDPParseState sdp_parse_state, *s1 = &sdp_parse_state; + SDPParseState sdp_parse_state = { { 0 } }, *s1 = &sdp_parse_state; - memset(s1, 0, sizeof(SDPParseState)); p = content; for (;;) { p += strspn(p, SPACE_CHARS); @@ -1955,7 +1953,7 @@ static int rtp_read_header(AVFormatContext *s) int ret, port; URLContext* in = NULL; int payload_type; - AVCodecContext codec; + AVCodecContext codec = { 0 }; struct sockaddr_storage addr; AVIOContext pb; socklen_t addrlen = sizeof(addr); @@ -1996,7 +1994,6 @@ static int rtp_read_header(AVFormatContext *s) ffurl_close(in); in = NULL; - memset(&codec, 0, sizeof(codec)); if (ff_rtp_get_codec_info(&codec, payload_type)) { av_log(s, AV_LOG_ERROR, "Unable to receive RTP payload type %d " "without an SDP file describing it\n", |