[FFmpeg-cvslog] mpeg4_update_thread_context: copy the whole mpeg4 specific context instead of variables one by one

Michael Niedermayer git at videolan.org
Sat Nov 30 03:20:47 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Nov 30 03:11:56 2013 +0100| [79c1cdd973cb8abcbb95affd3fd6d8ba75e980f2] | committer: Michael Niedermayer

mpeg4_update_thread_context: copy the whole mpeg4 specific context instead of variables one by one

This simplifies the code

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=79c1cdd973cb8abcbb95affd3fd6d8ba75e980f2
---

 libavcodec/mpeg4videodec.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 6f93f2b..cc0f505 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -2680,14 +2680,7 @@ static int mpeg4_update_thread_context(AVCodecContext *dst,
     if (ret < 0)
         return ret;
 
-    s->shape               = s1->shape;
-    s->time_increment_bits = s1->time_increment_bits;
-    s->vol_sprite_usage    = s1->vol_sprite_usage;
-    s->rvlc                = s1->rvlc;
-    s->divx_version        = s1->divx_version;
-    s->divx_build          = s1->divx_build;
-    s->xvid_build          = s1->xvid_build;
-    s->lavc_build          = s1->lavc_build;
+    memcpy(((uint8_t*)s) + sizeof(MpegEncContext), ((uint8_t*)s1) + sizeof(MpegEncContext), sizeof(Mpeg4DecContext) - sizeof(MpegEncContext));
 
     return 0;
 }



More information about the ffmpeg-cvslog mailing list