summaryrefslogtreecommitdiff
path: root/src/libffmpeg
diff options
context:
space:
mode:
Diffstat (limited to 'src/libffmpeg')
-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 ) {