mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-22 01:08:56 +00:00
LibMedia: Remove the duration field from Track::VideoData
Most demuxer users will only care about the whole file's duration anyway, so this field doesn't really do us any good.
This commit is contained in:
parent
db5fd614ac
commit
8d64e72655
Notes:
github-actions[bot]
2025-09-12 09:25:18 +00:00
Author: https://github.com/Zaggy1024
Commit: 8d64e72655
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6165
Reviewed-by: https://github.com/gmta ✅
4 changed files with 7 additions and 5 deletions
|
@ -48,8 +48,12 @@ DecoderErrorOr<Vector<Track>> MatroskaDemuxer::get_tracks_for_type(TrackType typ
|
|||
|
||||
switch (type) {
|
||||
case TrackType::Video:
|
||||
if (auto video_track = track_entry.video_track(); video_track.has_value())
|
||||
track.set_video_data({ TRY(duration(track)), video_track->pixel_width, video_track->pixel_height });
|
||||
if (auto video_track = track_entry.video_track(); video_track.has_value()) {
|
||||
track.set_video_data({
|
||||
.pixel_width = video_track->pixel_width,
|
||||
.pixel_height = video_track->pixel_height
|
||||
});
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -116,7 +116,6 @@ DecoderErrorOr<Vector<Track>> FFmpegDemuxer::get_tracks_for_type(TrackType type)
|
|||
|
||||
if (type == TrackType::Video) {
|
||||
track.set_video_data({
|
||||
.duration = TRY(duration_of_track(track)),
|
||||
.pixel_width = static_cast<u64>(stream->codecpar->width),
|
||||
.pixel_height = static_cast<u64>(stream->codecpar->height),
|
||||
});
|
||||
|
|
|
@ -22,7 +22,6 @@ enum class TrackType : u32 {
|
|||
|
||||
class Track {
|
||||
struct VideoData {
|
||||
AK::Duration duration {};
|
||||
u64 pixel_width { 0 };
|
||||
u64 pixel_height { 0 };
|
||||
};
|
||||
|
|
|
@ -110,7 +110,7 @@ AK::Duration VideoTrack::position() const
|
|||
|
||||
AK::Duration VideoTrack::duration() const
|
||||
{
|
||||
return m_playback_manager->selected_video_track().video_data().duration;
|
||||
return m_playback_manager->duration();
|
||||
}
|
||||
|
||||
void VideoTrack::seek(AK::Duration position, MediaSeekMode seek_mode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue