changeset 8044:8c1e1047ec78 libavcodec

add state64 field to ParseContext storing last 8 bytes, to be able to check for longer startcodes
author bcoudurier
date Thu, 23 Oct 2008 17:12:41 +0000
parents a591c3736fd8
children 444659c2b8a6
files parser.c parser.h
diffstat 2 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/parser.c	Thu Oct 23 07:30:16 2008 +0000
+++ b/parser.c	Thu Oct 23 17:12:41 2008 +0000
@@ -274,6 +274,7 @@
     /* store overread bytes */
     for(;next < 0; next++){
         pc->state = (pc->state<<8) | pc->buffer[pc->last_index + next];
+        pc->state64 = (pc->state64<<8) | pc->buffer[pc->last_index + next];
         pc->overread++;
     }
 
--- a/parser.h	Thu Oct 23 07:30:16 2008 +0000
+++ b/parser.h	Thu Oct 23 17:12:41 2008 +0000
@@ -34,6 +34,7 @@
     int frame_start_found;
     int overread;               ///< the number of bytes which where irreversibly read from the next frame
     int overread_index;         ///< the index into ParseContext.buffer of the overread bytes
+    uint64_t state64;           ///< contains the last 8 bytes in MSB order
 } ParseContext;
 
 struct MpegEncContext;