|
|
|
@@ -4414,3 +4414,25 @@ const struct AVCodecTag *avformat_get_riff_audio_tags(void) |
|
|
|
{ |
|
|
|
return ff_codec_wav_tags; |
|
|
|
} |
|
|
|
|
|
|
|
AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *stream, AVFrame *frame) |
|
|
|
{ |
|
|
|
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; |
|
|
|
|
|
|
|
av_reduce(&stream_sample_aspect_ratio.num, &stream_sample_aspect_ratio.den, |
|
|
|
stream_sample_aspect_ratio.num, stream_sample_aspect_ratio.den, INT_MAX); |
|
|
|
if (stream_sample_aspect_ratio.num <= 0 || stream_sample_aspect_ratio.den <= 0) |
|
|
|
stream_sample_aspect_ratio = undef; |
|
|
|
|
|
|
|
av_reduce(&frame_sample_aspect_ratio.num, &frame_sample_aspect_ratio.den, |
|
|
|
frame_sample_aspect_ratio.num, frame_sample_aspect_ratio.den, INT_MAX); |
|
|
|
if (frame_sample_aspect_ratio.num <= 0 || frame_sample_aspect_ratio.den <= 0) |
|
|
|
frame_sample_aspect_ratio = undef; |
|
|
|
|
|
|
|
if (stream_sample_aspect_ratio.num) |
|
|
|
return stream_sample_aspect_ratio; |
|
|
|
else |
|
|
|
return frame_sample_aspect_ratio; |
|
|
|
} |