diff mbox series

[FFmpeg-devel,7/7] avcodec/cbs_mpeg2: Use smaller scope for variables

Message ID AM7PR03MB6660C1EA678D25F4C72F698C8F299@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 67e1013a961e2f5dad467dd874d15819788080c0
Headers show
Series [FFmpeg-devel,1/7] avcodec/cbs_mpeg2: Remove redundant counter | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished

Commit Message

Andreas Rheinhardt Feb. 4, 2022, 3:16 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/cbs_mpeg2.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/cbs_mpeg2.c b/libavcodec/cbs_mpeg2.c
index 8d45d1ceeb..dfea12ef1b 100644
--- a/libavcodec/cbs_mpeg2.c
+++ b/libavcodec/cbs_mpeg2.c
@@ -144,10 +144,8 @@  static int cbs_mpeg2_split_fragment(CodedBitstreamContext *ctx,
                                     CodedBitstreamFragment *frag,
                                     int header)
 {
-    const uint8_t *start, *end;
-    CodedBitstreamUnitType unit_type;
+    const uint8_t *start;
     uint32_t start_code = -1;
-    size_t unit_size;
     int err;
 
     start = avpriv_find_start_code(frag->data, frag->data + frag->data_size,
@@ -158,7 +156,9 @@  static int cbs_mpeg2_split_fragment(CodedBitstreamContext *ctx,
     }
 
     do {
-        unit_type = start_code & 0xff;
+        CodedBitstreamUnitType unit_type = start_code & 0xff;
+        const uint8_t *end;
+        size_t unit_size;
 
         // Reset start_code to ensure that avpriv_find_start_code()
         // really reads a new start code and does not reuse the old