Browse code

add state64 field to ParseContext storing last 8 bytes, to be able to check for longer startcodes

Originally committed as revision 15671 to svn://svn.ffmpeg.org/ffmpeg/trunk

Baptiste Coudurier authored on 2008/10/24 02:12:41
Showing 2 changed files
... ...
@@ -274,6 +274,7 @@ int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_s
274 274
     /* store overread bytes */
275 275
     for(;next < 0; next++){
276 276
         pc->state = (pc->state<<8) | pc->buffer[pc->last_index + next];
277
+        pc->state64 = (pc->state64<<8) | pc->buffer[pc->last_index + next];
277 278
         pc->overread++;
278 279
     }
279 280
 
... ...
@@ -34,6 +34,7 @@ typedef struct ParseContext{
34 34
     int frame_start_found;
35 35
     int overread;               ///< the number of bytes which where irreversibly read from the next frame
36 36
     int overread_index;         ///< the index into ParseContext.buffer of the overread bytes
37
+    uint64_t state64;           ///< contains the last 8 bytes in MSB order
37 38
 } ParseContext;
38 39
 
39 40
 struct MpegEncContext;