feat: match IINA screenshot geometry and controls
This commit is contained in:
@@ -179,6 +179,12 @@ struct Player {
|
||||
state.duration = duration;
|
||||
state.has_audio = tracks[0].codec != nullptr;
|
||||
state.has_video = tracks[1].codec != nullptr;
|
||||
state.video_aspect_ratio = 0;
|
||||
if (const auto *video = tracks[1].codec; video && video->width > 0 && video->height > 0) {
|
||||
const auto aspect = av_guess_sample_aspect_ratio(format, format->streams[tracks[1].index], nullptr);
|
||||
state.video_aspect_ratio = double(video->width) / video->height *
|
||||
(aspect.num > 0 && aspect.den > 0 ? av_q2d(aspect) : 1);
|
||||
}
|
||||
std::memcpy(state.error, error.data(), error.size());
|
||||
++state.revision;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user