[FFmpeg-devel] [PATCH] avformat/http: use assignment of structure instead of memcpy
Zhao Zhili
quinkblack at foxmail.com
Tue Oct 17 19:19:37 EEST 2017
---
libavformat/http.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/libavformat/http.c b/libavformat/http.c
index 668cd51986..63dfd51117 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -173,12 +173,10 @@ static int http_read_header(URLContext *h, int *new_location);
void ff_http_init_auth_state(URLContext *dest, const URLContext *src)
{
- memcpy(&((HTTPContext *)dest->priv_data)->auth_state,
- &((HTTPContext *)src->priv_data)->auth_state,
- sizeof(HTTPAuthState));
- memcpy(&((HTTPContext *)dest->priv_data)->proxy_auth_state,
- &((HTTPContext *)src->priv_data)->proxy_auth_state,
- sizeof(HTTPAuthState));
+ HTTPContext *d = dest->priv_data;
+ HTTPContext *s = src->priv_data;
+ d->auth_state = s->auth_state;
+ d->proxy_auth_state = s->proxy_auth_state;
}
static int http_open_cnx_internal(URLContext *h, AVDictionary **options)
--
2.14.2
More information about the ffmpeg-devel
mailing list