mirror of
https://github.com/samsonjs/media.git
synced 2026-04-05 11:15:46 +00:00
Fix end of stream detection for SSIM helper
PiperOrigin-RevId: 436165237
This commit is contained in:
parent
47b6195340
commit
3f5d723311
1 changed files with 4 additions and 1 deletions
|
|
@ -279,7 +279,10 @@ public final class SsimHelper {
|
|||
sampleSize,
|
||||
mediaExtractor.getSampleTime(),
|
||||
mediaExtractor.getSampleFlags());
|
||||
hasReadEndOfInputStream = !mediaExtractor.advance();
|
||||
// MediaExtractor.advance does not reliably return false for end-of-stream, so check sample
|
||||
// metadata instead as a more reliable signal. See [internal: b/121204004].
|
||||
mediaExtractor.advance();
|
||||
hasReadEndOfInputStream = mediaExtractor.getSampleTime() == -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue