diff options
author | Mike Melanson <mike@multimedia.cx> | 2004-03-13 20:07:38 +0000 |
---|---|---|
committer | Mike Melanson <mike@multimedia.cx> | 2004-03-13 20:07:38 +0000 |
commit | 14284f78c57a7626f1d3d42683abd0169363a269 (patch) | |
tree | 4a57de78bf60c417d00cb8bb2abfe374c570fef4 /libavcodec/svq3.c | |
parent | bda702fc4dc3540ef0e40f3039d501803c8ce4b1 (diff) | |
download | ffmpeg-14284f78c57a7626f1d3d42683abd0169363a269.tar.gz |
smarten up the SVQ3 extradata decoder without changing the external API
Originally committed as revision 2878 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/svq3.c')
-rw-r--r-- | libavcodec/svq3.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index c8720c07aa..6a53ed2399 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -766,6 +766,7 @@ static int svq3_decode_frame (AVCodecContext *avctx, MpegEncContext *const s = avctx->priv_data; H264Context *const h = avctx->priv_data; int m, mb_type; + unsigned char *extradata; *data_size = 0; @@ -790,13 +791,20 @@ static int svq3_decode_frame (AVCodecContext *avctx, alloc_tables (h); - if (avctx->extradata && avctx->extradata_size >= 0x64 - && !memcmp (avctx->extradata, "SVQ3", 4)) { + /* prowl for the "SEQH" marker in the extradata */ + extradata = (unsigned char *)avctx->extradata; + for (m = 0; m < avctx->extradata_size; m++) { + if (!memcmp (extradata, "SEQH", 4)) + break; + extradata++; + } + + /* if a match was found, parse the extra data */ + if (!memcmp (extradata, "SEQH", 4)) { GetBitContext gb; - init_get_bits (&gb, (uint8_t *) avctx->extradata + 0x62, - 8*(avctx->extradata_size - 0x62)); + init_get_bits (&gb, extradata + 0x8, 8*8); /* 'frame size code' and optional 'width, height' */ if (get_bits (&gb, 3) == 7) { |