[FFmpeg-cvslog] lavf: also use codec aspect ratio in av_guess_sample_aspect_ratio

Marton Balint git at videolan.org
Sun May 20 19:36:56 CEST 2012


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sun May 20 15:53:02 2012 +0200| [b36a0a80fca1afe164ab97252d9f7f410869eff0] | committer: Michael Niedermayer

lavf: also use codec aspect ratio in av_guess_sample_aspect_ratio

Use codec aspect ratio for frame aspect ratio if AVFrame is NULL.

Signed-off-by: Marton Balint <cus at passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b36a0a80fca1afe164ab97252d9f7f410869eff0
---

 libavformat/utils.c   |    3 ++-
 libavformat/version.h |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index c2a5931..2d3ec0f 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4420,7 +4420,8 @@ AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *strea
 {
     AVRational undef = {0, 1};
     AVRational stream_sample_aspect_ratio = stream ? stream->sample_aspect_ratio : undef;
-    AVRational frame_sample_aspect_ratio  = frame  ? frame->sample_aspect_ratio  : undef;
+    AVRational codec_sample_aspect_ratio  = stream && stream->codec ? stream->codec->sample_aspect_ratio : undef;
+    AVRational frame_sample_aspect_ratio  = frame  ? frame->sample_aspect_ratio  : codec_sample_aspect_ratio;
 
     av_reduce(&stream_sample_aspect_ratio.num, &stream_sample_aspect_ratio.den,
                stream_sample_aspect_ratio.num,  stream_sample_aspect_ratio.den, INT_MAX);
diff --git a/libavformat/version.h b/libavformat/version.h
index 17f8b16..afc235c 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,7 +31,7 @@
 
 #define LIBAVFORMAT_VERSION_MAJOR 54
 #define LIBAVFORMAT_VERSION_MINOR  5
-#define LIBAVFORMAT_VERSION_MICRO 100
+#define LIBAVFORMAT_VERSION_MICRO 101
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \



More information about the ffmpeg-cvslog mailing list