mirror of
https://github.com/mpv-player/mpv
synced 2025-01-18 04:51:52 +00:00
use new lavf API to grab sample_aspect_ratio from the demuxers
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27479 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
d5df440c7f
commit
68ac7b23dd
@ -343,6 +343,10 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) {
|
||||
sh_video->fps=av_q2d(st->r_frame_rate);
|
||||
sh_video->frametime=1/av_q2d(st->r_frame_rate);
|
||||
sh_video->format=bih->biCompression;
|
||||
if(st->sample_aspect_ratio.num)
|
||||
sh_video->aspect = codec->width * st->sample_aspect_ratio.num
|
||||
/ (float)(codec->height * st->sample_aspect_ratio.den);
|
||||
else
|
||||
sh_video->aspect=codec->width * codec->sample_aspect_ratio.num
|
||||
/ (float)(codec->height * codec->sample_aspect_ratio.den);
|
||||
sh_video->i_bps=codec->bit_rate/8;
|
||||
|
Loading…
Reference in New Issue
Block a user