From 9d0f3c3a83276b0ce886fd6720fc8879f2add1b9 Mon Sep 17 00:00:00 2001 From: James Stembridge Date: Sat, 4 Jun 2005 10:54:22 +0000 Subject: Fix handling of BUF_FLAG_FRAMERATE and BUF_FLAG_ASPECT CVS patchset: 7601 CVS date: 2005/06/04 10:54:22 --- src/libffmpeg/video_decoder.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/libffmpeg/video_decoder.c b/src/libffmpeg/video_decoder.c index 82d74ed6b..01ed89a0b 100644 --- a/src/libffmpeg/video_decoder.c +++ b/src/libffmpeg/video_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_decoder.c,v 1.51 2005/05/30 16:01:52 jstembridge Exp $ + * $Id: video_decoder.c,v 1.52 2005/06/04 10:54:22 jstembridge Exp $ * * xine video decoder plugin using ffmpeg * @@ -1231,21 +1231,23 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { ff_handle_header_buffer(this, buf); - } else { + } + + if (buf->decoder_flags & BUF_FLAG_FRAMERATE) { + this->video_step = buf->decoder_info[0]; + _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->video_step); + } + + if (buf->decoder_flags & BUF_FLAG_ASPECT) { + this->aspect_ratio = (double)buf->decoder_info[1] / (double)buf->decoder_info[2]; + _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_RATIO, + this->aspect_ratio*10000); + } + + if (!(buf->decoder_flags & BUF_FLAG_HEADER)) { /* decode */ - if (buf->decoder_flags & BUF_FLAG_FRAMERATE) { - this->video_step = buf->decoder_info[0]; - _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->video_step); - } - - if (buf->decoder_flags & BUF_FLAG_ASPECT) { - this->aspect_ratio = (double)buf->decoder_info[1] / (double)buf->decoder_info[2]; - _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_RATIO, - this->aspect_ratio*10000); - } - /* aspect ratio */ if(!this->bih.biWidth || !this->bih.biHeight) { this->bih.biWidth = this->context->width; -- cgit v1.2.3