[FFmpeg-cvslog] avcodec/mpeg4videoenc: Use stack variable for aspect_ratio_info

Andreas Rheinhardt git at videolan.org
Sat Jan 29 21:02:27 EET 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue Jan 25 13:18:59 2022 +0100| [b326c2dcdcb7bf3011f2c1fa0c259ca94b50fd45] | committer: Andreas Rheinhardt

avcodec/mpeg4videoenc: Use stack variable for aspect_ratio_info

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 libavcodec/mpeg4videoenc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c
index b3e697daf7..27e16c3b72 100644
--- a/libavcodec/mpeg4videoenc.c
+++ b/libavcodec/mpeg4videoenc.c
@@ -961,7 +961,7 @@ static void mpeg4_encode_vol_header(MpegEncContext *s,
                                     int vo_number,
                                     int vol_number)
 {
-    int vo_ver_id, vo_type;
+    int vo_ver_id, vo_type, aspect_ratio_info;
 
     if (s->max_b_frames || s->quarter_sample) {
         vo_ver_id  = 5;
@@ -986,10 +986,10 @@ static void mpeg4_encode_vol_header(MpegEncContext *s,
         put_bits(&s->pb, 3, 1);         /* is obj layer priority */
     }
 
-    s->aspect_ratio_info = ff_h263_aspect_to_info(s->avctx->sample_aspect_ratio);
+    aspect_ratio_info = ff_h263_aspect_to_info(s->avctx->sample_aspect_ratio);
 
-    put_bits(&s->pb, 4, s->aspect_ratio_info); /* aspect ratio info */
-    if (s->aspect_ratio_info == FF_ASPECT_EXTENDED) {
+    put_bits(&s->pb, 4, aspect_ratio_info); /* aspect ratio info */
+    if (aspect_ratio_info == FF_ASPECT_EXTENDED) {
         av_reduce(&s->avctx->sample_aspect_ratio.num, &s->avctx->sample_aspect_ratio.den,
                    s->avctx->sample_aspect_ratio.num,  s->avctx->sample_aspect_ratio.den, 255);
         put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.num);



More information about the ffmpeg-cvslog mailing list