From d211575f64577027568ff85497eb357f878401fb Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Tue, 9 Aug 2011 16:04:31 +0300 Subject: Cosmetics: reordered functions --- src/combined/ffmpeg/ff_video_decoder.c | 86 +++++++++++++++++----------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c index 2c2a08cc1..92fee481f 100644 --- a/src/combined/ffmpeg/ff_video_decoder.c +++ b/src/combined/ffmpeg/ff_video_decoder.c @@ -862,6 +862,49 @@ static void ff_check_bufsize (ff_video_decoder_t *this, int size) { } } +static int ff_vc1_find_header(ff_video_decoder_t *this, buf_element_t *buf) +{ + uint8_t *p = buf->content; + + if (!p[0] && !p[1] && p[2] == 1 && p[3] == 0x0f) { + int i; + + this->context->extradata = calloc(1, buf->size); + this->context->extradata_size = 0; + + for (i = 0; i < buf->size && i < 128; i++) { + if (!p[i] && !p[i+1] && p[i+2]) { + lprintf("00 00 01 %02x at %d\n", p[i+3], i); + if (p[i+3] != 0x0e && p[i+3] != 0x0f) + break; + } + this->context->extradata[i] = p[i]; + this->context->extradata_size++; + } + + lprintf("ff_video_decoder: found VC1 sequence header\n"); + return 1; + } + + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "ffmpeg_video_dec: VC1 extradata missing !\n"); + return 0; +} + +static int ff_check_extradata(ff_video_decoder_t *this, unsigned int codec_type, buf_element_t *buf) +{ + if (this->context && this->context->extradata) + return 1; + + switch (codec_type) { + case BUF_VIDEO_VC1: + return ff_vc1_find_header(this, buf); + default:; + } + + return 1; +} + static void ff_handle_preview_buffer (ff_video_decoder_t *this, buf_element_t *buf) { int codec_type; @@ -1223,49 +1266,6 @@ static void ff_check_pts_tagging(ff_video_decoder_t *this, uint64_t pts) } #endif /* AVCODEC_HAS_REORDERED_OPAQUE */ -static int ff_vc1_find_header(ff_video_decoder_t *this, buf_element_t *buf) -{ - uint8_t *p = buf->content; - - if (!p[0] && !p[1] && p[2] == 1 && p[3] == 0x0f) { - int i; - - this->context->extradata = calloc(1, buf->size); - this->context->extradata_size = 0; - - for (i = 0; i < buf->size && i < 128; i++) { - if (!p[i] && !p[i+1] && p[i+2]) { - lprintf("00 00 01 %02x at %d\n", p[i+3], i); - if (p[i+3] != 0x0e && p[i+3] != 0x0f) - break; - } - this->context->extradata[i] = p[i]; - this->context->extradata_size++; - } - - lprintf("ff_video_decoder: found VC1 sequence header\n"); - return 1; - } - - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, - "ffmpeg_video_dec: VC1 extradata missing !\n"); - return 0; -} - -static int ff_check_extradata(ff_video_decoder_t *this, unsigned int codec_type, buf_element_t *buf) -{ - if (this->context && this->context->extradata) - return 1; - - switch (codec_type) { - case BUF_VIDEO_VC1: - return ff_vc1_find_header(this, buf); - default:; - } - - return 1; -} - static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) { uint8_t *chunk_buf = this->buf; AVRational avr00 = {0, 1}; -- cgit v1.2.3