mirror of
https://github.com/samsonjs/media.git
synced 2026-03-25 09:25:53 +00:00
Propagate sourceEnded to AudioGraphInputAudioSink
PiperOrigin-RevId: 702076933
This commit is contained in:
parent
8908d82cac
commit
ecdf7c5df7
2 changed files with 7 additions and 4 deletions
|
|
@ -73,8 +73,11 @@ import java.util.Objects;
|
|||
/**
|
||||
* Returns the position (in microseconds) that should be {@linkplain
|
||||
* AudioSink#getCurrentPositionUs returned} by this sink.
|
||||
*
|
||||
* @param sourceEnded Specify {@code true} if no more input buffers will be provided.
|
||||
* @return The playback position relative to the start of playback, in microseconds.
|
||||
*/
|
||||
long getCurrentPositionUs();
|
||||
long getCurrentPositionUs(boolean sourceEnded);
|
||||
|
||||
/** Returns whether the controller is ended. */
|
||||
boolean isEnded();
|
||||
|
|
@ -216,7 +219,7 @@ import java.util.Objects;
|
|||
|
||||
@Override
|
||||
public long getCurrentPositionUs(boolean sourceEnded) {
|
||||
long currentPositionUs = controller.getCurrentPositionUs();
|
||||
long currentPositionUs = controller.getCurrentPositionUs(sourceEnded);
|
||||
if (currentPositionUs != CURRENT_POSITION_NOT_SET) {
|
||||
// Reset the position to the one expected by the player.
|
||||
currentPositionUs -= offsetToCompositionTimeUs;
|
||||
|
|
|
|||
|
|
@ -188,8 +188,8 @@ import java.util.Objects;
|
|||
}
|
||||
|
||||
@Override
|
||||
public long getCurrentPositionUs() {
|
||||
return finalAudioSink.getCurrentPositionUs(/* sourceEnded= */ false);
|
||||
public long getCurrentPositionUs(boolean sourceEnded) {
|
||||
return finalAudioSink.getCurrentPositionUs(sourceEnded);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in a new issue