summaryrefslogtreecommitdiff
path: root/src/libffmpeg/video_decoder.c
diff options
context:
space:
mode:
authorJames Stembridge <jstembridge@users.sourceforge.net>2004-02-14 20:29:53 +0000
committerJames Stembridge <jstembridge@users.sourceforge.net>2004-02-14 20:29:53 +0000
commit351e2803fd969a77e02674fcfb0e9dcd7cd5f8fd (patch)
treef00153451e09db68bff31a2c0230a30e07c36130 /src/libffmpeg/video_decoder.c
parent43ee345460df89838e2296921dd4d2030a03b1b2 (diff)
downloadxine-lib-351e2803fd969a77e02674fcfb0e9dcd7cd5f8fd.tar.gz
xine-lib-351e2803fd969a77e02674fcfb0e9dcd7cd5f8fd.tar.bz2
Read aspect when BUF_FLAG_ASPECT is set
CVS patchset: 6156 CVS date: 2004/02/14 20:29:53
Diffstat (limited to 'src/libffmpeg/video_decoder.c')
-rw-r--r--src/libffmpeg/video_decoder.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/libffmpeg/video_decoder.c b/src/libffmpeg/video_decoder.c
index 7ece3413c..2111d4130 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.7 2004/02/14 19:52:41 jstembridge Exp $
+ * $Id: video_decoder.c,v 1.8 2004/02/14 20:32:12 jstembridge Exp $
*
* xine video decoder plugin using ffmpeg
*
@@ -221,9 +221,12 @@ static void init_video_codec (ff_video_decoder_t *this, xine_bmiheader *bih) {
}
this->decoder_ok = 1;
+
+ this->aspect_ratio = (double)this->bih.biWidth / (double)this->bih.biHeight;
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, this->context->width);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, this->context->height);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, this->context->width);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, this->context->height);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_RATIO, this->aspect_ratio*10000);
this->stream->video_out->open (this->stream->video_out, this->stream);
@@ -933,6 +936,12 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
_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 (this->decoder_ok && this->size) {
if ( (buf->decoder_flags & BUF_FLAG_FRAME_END) || this->is_continous ) {