summaryrefslogtreecommitdiff
path: root/src/libffmpeg/video_decoder.c
diff options
context:
space:
mode:
authorJames Stembridge <jstembridge@users.sourceforge.net>2004-02-14 19:52:41 +0000
committerJames Stembridge <jstembridge@users.sourceforge.net>2004-02-14 19:52:41 +0000
commit7989f06458279491b5e3d0fa764e2788c3bcd6ba (patch)
treea413586fe574f156f97062e3feead1f575af1631 /src/libffmpeg/video_decoder.c
parent4169f065155edea00c4b7953315fbf23f4ed8170 (diff)
downloadxine-lib-7989f06458279491b5e3d0fa764e2788c3bcd6ba.tar.gz
xine-lib-7989f06458279491b5e3d0fa764e2788c3bcd6ba.tar.bz2
Only use aspect ratio given by ffmpeg if it isn't equal to 0.0
CVS patchset: 6154 CVS date: 2004/02/14 19:52:41
Diffstat (limited to 'src/libffmpeg/video_decoder.c')
-rw-r--r--src/libffmpeg/video_decoder.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libffmpeg/video_decoder.c b/src/libffmpeg/video_decoder.c
index 2b63970c8..7ece3413c 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.6 2004/02/09 22:11:30 jstembridge Exp $
+ * $Id: video_decoder.c,v 1.7 2004/02/14 19:52:41 jstembridge Exp $
*
* xine video decoder plugin using ffmpeg
*
@@ -1001,8 +1001,12 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
lprintf ("got a picture\n");
- this->aspect_ratio = av_q2d(this->context->sample_aspect_ratio) *
- (double) this->context->width / (double) this->context->height;
+ if(av_cmp_q(this->context->sample_aspect_ratio, (AVRational){0,0})) {
+ this->aspect_ratio = av_q2d(this->context->sample_aspect_ratio) *
+ (double)this->context->width / (double)this->context->height;
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_RATIO,
+ this->aspect_ratio*10000);
+ }
if(!this->av_frame->opaque) {
img = this->stream->video_out->get_frame (this->stream->video_out,