feat: match IINA screenshot geometry and controls

This commit is contained in:
2026-10-10 14:04:09 +02:00
parent 462cb52eb2
commit c9b9264109
6 changed files with 186 additions and 43 deletions
+6
View File
@@ -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;
}
+2
View File
@@ -17,6 +17,8 @@ typedef struct PlayerState {
double duration;
bool has_audio;
bool has_video;
// Display width / height, including sample aspect ratio; zero without video.
double video_aspect_ratio;
uint64_t revision;
char error[512];
} PlayerState;