Skip to content

Commit

Permalink
lavf: also use codec aspect ratio in av_guess_sample_aspect_ratio
Browse files Browse the repository at this point in the history
Use codec aspect ratio for frame aspect ratio if AVFrame is NULL.

Signed-off-by: Marton Balint <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
cus authored and michaelni committed May 20, 2012
1 parent 4a5d18b commit b36a0a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion libavformat/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion libavformat/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down

0 comments on commit b36a0a8

Please sign in to comment.