Browse code

h264_mp4toannexb_bsf: use i instead of misusing unit_type.

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

Michael Niedermayer authored on 2012/03/22 06:33:28
Showing 1 changed files
... ...
@@ -59,6 +59,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
59 59
                                    const uint8_t *buf, int      buf_size,
60 60
                                    int keyframe) {
61 61
     H264BSFContext *ctx = bsfc->priv_data;
62
+    int i;
62 63
     uint8_t unit_type;
63 64
     int32_t nal_size;
64 65
     uint32_t cumul_size = 0;
... ...
@@ -140,8 +141,8 @@ pps:
140 140
         if (buf + ctx->length_size > buf_end)
141 141
             goto fail;
142 142
 
143
-        for(nal_size = 0, unit_type = 0; unit_type<ctx->length_size; unit_type++)
144
-            nal_size = (nal_size << 8) | buf[unit_type];
143
+        for (nal_size = 0, i = 0; i<ctx->length_size; i++)
144
+            nal_size = (nal_size << 8) | buf[i];
145 145
 
146 146
         buf += ctx->length_size;
147 147
         unit_type = *buf & 0x1f;