mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibMedia: Stop initializing an empty optional in MatroskaDemuxer
There was a warning for the Optional initializer having no effect, but removing the initializer caused the call to add a track to the HashMap to complain. A constructor looks a little nicer here anyway.
This commit is contained in:
parent
ae7f82591b
commit
9077873803
Notes:
github-actions[bot]
2025-09-12 09:24:59 +00:00
Author: https://github.com/Zaggy1024
Commit: 9077873803
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6165
Reviewed-by: https://github.com/gmta ✅
2 changed files with 7 additions and 2 deletions
|
|
@ -108,7 +108,7 @@ DecoderErrorOr<MatroskaDemuxer::TrackStatus*> MatroskaDemuxer::get_track_status(
|
|||
{
|
||||
if (!m_track_statuses.contains(track)) {
|
||||
auto iterator = TRY(m_reader.create_sample_iterator(track.identifier()));
|
||||
DECODER_TRY_ALLOC(m_track_statuses.try_set(track, { iterator }));
|
||||
DECODER_TRY_ALLOC(m_track_statuses.try_set(track, TrackStatus(move(iterator))));
|
||||
}
|
||||
|
||||
return &m_track_statuses.get(track).release_value();
|
||||
|
|
|
|||
|
|
@ -44,8 +44,13 @@ public:
|
|||
private:
|
||||
struct TrackStatus {
|
||||
SampleIterator iterator;
|
||||
Optional<Block> block {};
|
||||
Optional<Block> block;
|
||||
size_t frame_index { 0 };
|
||||
|
||||
TrackStatus(SampleIterator&& iterator)
|
||||
: iterator(iterator)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
DecoderErrorOr<TrackStatus*> get_track_status(Track track);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue