From d880e292d0041db40dd7cb1e6549808f9a8e7a20 Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Sun, 22 Sep 2013 12:07:27 +0300 Subject: Fix VC1 decoding --- src/combined/ffmpeg/ff_video_decoder.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src') diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c index b07d687b2..2de40409b 100644 --- a/src/combined/ffmpeg/ff_video_decoder.c +++ b/src/combined/ffmpeg/ff_video_decoder.c @@ -1100,6 +1100,35 @@ static int ff_vc1_find_header(ff_video_decoder_t *this, buf_element_t *buf) } lprintf("ff_video_decoder: found VC1 sequence header\n"); + +#if AVPARSE > 1 + AVCodecParserContext *parser_context; + uint8_t *outbuf; + int outsize; + + parser_context = av_parser_init(CODEC_ID_VC1); + if (!parser_context) { + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + "ffmpeg_video_dec: couldn't init VC1 parser\n"); + return 1; + } + + parser_context->flags |= PARSER_FLAG_COMPLETE_FRAMES; + av_parser_parse2 (parser_context, this->context, + &outbuf, &outsize, this->context->extradata, this->context->extradata_size, + 0, 0, 0); + + + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + "ffmpeg_video_dec: parsed VC1 video size %dx%d\n", + this->context->width, this->context->height); + + this->bih.biWidth = this->context->width; + this->bih.biHeight = this->context->height; + + av_parser_close(parser_context); +#endif /* AVPARSE > 1 */ + return 1; } -- cgit v1.2.3