@@ -66,28 +66,32 @@ ByteVector Matroska::Cues::renderInternal()
6666 // Relative position, optional
6767 if (cueTrack->getRelativePosition ().has_value ()) {
6868 auto relativePosition = EBML::make_unique_element<EBML::Element::Id::MkCueRelativePosition>();
69- relativePosition->setValue (cueTrack->getRelativePosition ().value ());
69+ // operator*() used instead of value() to support restricted compilers
70+ relativePosition->setValue (*cueTrack->getRelativePosition ());
7071 cueTrackElement->appendElement (std::move (relativePosition));
7172 }
7273
7374 // Duration, optional
7475 if (cueTrack->getDuration ().has_value ()) {
7576 auto duration = EBML::make_unique_element<EBML::Element::Id::MkCueDuration>();
76- duration->setValue (cueTrack->getDuration ().value ());
77+ // operator*() used instead of value() to support restricted compilers
78+ duration->setValue (*cueTrack->getDuration ());
7779 cueTrackElement->appendElement (std::move (duration));
7880 }
7981
8082 // Block number, optional
8183 if (cueTrack->getBlockNumber ().has_value ()) {
8284 auto blockNumber = EBML::make_unique_element<EBML::Element::Id::MkCueBlockNumber>();
83- blockNumber->setValue (cueTrack->getBlockNumber ().value ());
85+ // operator*() used instead of value() to support restricted compilers
86+ blockNumber->setValue (*cueTrack->getBlockNumber ());
8487 cueTrackElement->appendElement (std::move (blockNumber));
8588 }
8689
8790 // Codec state, not in version 1
8891 if (cueTrack->getCodecState ().has_value ()) {
8992 auto codecState = EBML::make_unique_element<EBML::Element::Id::MkCueCodecState>();
90- codecState->setValue (cueTrack->getCodecState ().value ());
93+ // operator*() used instead of value() to support restricted compilers
94+ codecState->setValue (*cueTrack->getCodecState ());
9195 cueTrackElement->appendElement (std::move (codecState));
9296 }
9397
@@ -209,8 +213,9 @@ bool Matroska::CueTrack::isValid(TagLib::File &file, offset_t segmentDataOffset)
209213 debug (" No cluster found at position" );
210214 return false ;
211215 }
212- if (codecState.has_value () && codecState.value () != 0 ) {
213- file.seek (segmentDataOffset + codecState.value ());
216+ if (codecState.has_value () && *codecState != 0 ) {
217+ // operator*() used instead of value() to support restricted compilers
218+ file.seek (segmentDataOffset + *codecState);
214219 if (EBML::Element::readId (file) != static_cast <unsigned int >(EBML::Element::Id::MkCodecState)) {
215220 debug (" No codec state found at position" );
216221 return false ;
@@ -296,8 +301,9 @@ bool Matroska::CueTrack::adjustOffset(offset_t offset, offset_t delta)
296301 clusterPosition += delta;
297302 ret = true ;
298303 }
304+ // operator*() used instead of value() to support restricted compilers
299305 if (offset_t codecStateValue;
300- codecState.has_value () && (codecStateValue = codecState. value () ) != 0 &&
306+ codecState.has_value () && (codecStateValue = * codecState) != 0 &&
301307 codecStateValue > offset) {
302308 codecState = codecStateValue + delta;
303309 ret = true ;
0 commit comments