diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2008-08-23 23:13:58 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2008-08-23 23:13:58 +0000 |
commit | c30a4489b444020ef951c1f0583afd8679c07c78 (patch) | |
tree | 0ca4b5260d083c6c053b8424ce213448451a0736 /ffplay.c | |
parent | 0cdc6ec94130572e1da1902821e2b3cbcf0fbea8 (diff) | |
download | ffmpeg-c30a4489b444020ef951c1f0583afd8679c07c78.tar.gz |
export sample_aspect_ratio read by the demuxer in a separate field
that the one read by the decoder.
Originally committed as revision 14932 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffplay.c')
-rw-r--r-- | ffplay.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -657,14 +657,15 @@ static void video_image_display(VideoState *is) vp = &is->pictq[is->pictq_rindex]; if (vp->bmp) { /* XXX: use variable in the frame */ - if (is->video_st->codec->sample_aspect_ratio.num == 0) - aspect_ratio = 0; + if (is->video_st->sample_aspect_ratio.num) + aspect_ratio = av_q2d(is->video_st->sample_aspect_ratio); + else if (is->video_st->codec->sample_aspect_ratio.num) + aspect_ratio = av_q2d(is->video_st->codec->sample_aspect_ratio); else - aspect_ratio = av_q2d(is->video_st->codec->sample_aspect_ratio) - * is->video_st->codec->width / is->video_st->codec->height; + aspect_ratio = 0; if (aspect_ratio <= 0.0) - aspect_ratio = (float)is->video_st->codec->width / - (float)is->video_st->codec->height; + aspect_ratio = 1.0; + aspect_ratio *= (float)is->video_st->codec->width / is->video_st->codec->height; /* if an active format is indicated, then it overrides the mpeg format */ #if 0 |