From 33cf5de308a841526b2d6f11e83ab590acbc3539 Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Tue, 27 Sep 2011 14:28:12 +0300 Subject: Fixed mpeg2 decoding with ffmpeg. Codec was never opened when using mpeg12 mode. --- src/combined/ffmpeg/ff_video_decoder.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c index f9822723c..a1d729df4 100644 --- a/src/combined/ffmpeg/ff_video_decoder.c +++ b/src/combined/ffmpeg/ff_video_decoder.c @@ -521,17 +521,6 @@ static void init_postprocess (ff_video_decoder_t *this) { static int ff_handle_mpeg_sequence(ff_video_decoder_t *this, mpeg_parser_t *parser) { - /* - * init codec - */ - if (this->decoder_init_mode) { - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, - "mpeg-1 (ffmpeg)"); - - init_video_codec (this, BUF_VIDEO_MPEG); - this->decoder_init_mode = 0; - } - /* frame format change */ if ((parser->width != this->bih.biWidth) || (parser->height != this->bih.biHeight) || @@ -908,10 +897,18 @@ static int ff_check_extradata(ff_video_decoder_t *this, unsigned int codec_type, static void ff_init_mpeg12_mode(ff_video_decoder_t *this) { this->is_mpeg12 = 1; + + if (this->decoder_init_mode) { + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, + "mpeg-1 (ffmpeg)"); + + init_video_codec (this, BUF_VIDEO_MPEG); + this->decoder_init_mode = 0; + } + if ( this->mpeg_parser == NULL ) { this->mpeg_parser = calloc(1, sizeof(mpeg_parser_t)); mpeg_parser_init(this->mpeg_parser); - this->decoder_init_mode = 0; } } -- cgit v1.2.3