Commit 0dd9f2ec authored by aurel's avatar aurel

use the adjustment value present in FLV to crop VP6 video

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@6770 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent f04c8333
...@@ -64,6 +64,10 @@ static int vp6_parse_header(vp56_context_t *s, uint8_t *buf, int buf_size, ...@@ -64,6 +64,10 @@ static int vp6_parse_header(vp56_context_t *s, uint8_t *buf, int buf_size,
if (16*cols != s->avctx->coded_width || if (16*cols != s->avctx->coded_width ||
16*rows != s->avctx->coded_height) { 16*rows != s->avctx->coded_height) {
avcodec_set_dimensions(s->avctx, 16*cols, 16*rows); avcodec_set_dimensions(s->avctx, 16*cols, 16*rows);
if (s->avctx->extradata_size == 1) {
s->avctx->width -= s->avctx->extradata[0] >> 4;
s->avctx->height -= s->avctx->extradata[0] & 0x0F;
}
res = 2; res = 2;
} }
......
...@@ -193,7 +193,12 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -193,7 +193,12 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
case 3: st->codec->codec_id = CODEC_ID_FLASHSV; break; case 3: st->codec->codec_id = CODEC_ID_FLASHSV; break;
case 4: case 4:
st->codec->codec_id = CODEC_ID_VP6F; st->codec->codec_id = CODEC_ID_VP6F;
get_byte(&s->pb); /* width and height adjustment */ if (st->codec->extradata_size != 1) {
st->codec->extradata_size = 1;
st->codec->extradata = av_malloc(1);
}
/* width and height adjustment */
st->codec->extradata[0] = get_byte(&s->pb);
size--; size--;
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment