Mercurial > libavcodec.hg
comparison vc1_parser.c @ 9009:9a642761d734 libavcodec
Fix vc1 split().
Fixes Subtitle-sample.evo, issue52.
author | michael |
---|---|
date | Sun, 22 Feb 2009 20:48:12 +0000 |
parents | e9d9d946f213 |
children | c25359a56edf |
comparison
equal
deleted
inserted
replaced
9008:251c7a9cb795 | 9009:9a642761d734 |
---|---|
97 static int vc1_split(AVCodecContext *avctx, | 97 static int vc1_split(AVCodecContext *avctx, |
98 const uint8_t *buf, int buf_size) | 98 const uint8_t *buf, int buf_size) |
99 { | 99 { |
100 int i; | 100 int i; |
101 uint32_t state= -1; | 101 uint32_t state= -1; |
102 int charged=0; | |
102 | 103 |
103 for(i=0; i<buf_size; i++){ | 104 for(i=0; i<buf_size; i++){ |
104 state= (state<<8) | buf[i]; | 105 state= (state<<8) | buf[i]; |
105 if(IS_MARKER(state) && state != VC1_CODE_SEQHDR && state != VC1_CODE_ENTRYPOINT) | 106 if(IS_MARKER(state)){ |
106 return i-3; | 107 if(state == VC1_CODE_SEQHDR || state == VC1_CODE_ENTRYPOINT){ |
108 charged=1; | |
109 }else if(charged){ | |
110 return i-3; | |
111 } | |
112 } | |
107 } | 113 } |
108 return 0; | 114 return 0; |
109 } | 115 } |
110 | 116 |
111 AVCodecParser vc1_parser = { | 117 AVCodecParser vc1_parser = { |