File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -288,6 +288,14 @@ void SingleStreamDecoder::scanFileAndUpdateMetadataAndIndex() {
288288 streamMetadata.numFramesFromContent =
289289 streamInfos_[streamIndex].allFrames .size ();
290290
291+ // This ensures that we are robust in handling cases where
292+ // we are decoding in exact mode and numFrames is 0. The current metadata
293+ // validation logic assumes that these values should not be None
294+ if (streamMetadata.numFramesFromContent .value () == 0 ) {
295+ streamMetadata.beginStreamPtsFromContent = 0 ;
296+ streamMetadata.endStreamPtsFromContent = 0 ;
297+ }
298+
291299 if (streamMetadata.beginStreamPtsFromContent .has_value ()) {
292300 streamMetadata.beginStreamPtsSecondsFromContent = ptsToSeconds (
293301 *streamMetadata.beginStreamPtsFromContent , avStream->time_base );
You can’t perform that action at this time.
0 commit comments