Skip to content

Commit

Permalink
Merge pull request #1135 from canalplus/misc/playbackobserver-no-rxjs
Browse files Browse the repository at this point in the history
Remove RxJS from PlaybackObserver to fix potential leak
  • Loading branch information
peaBerberian authored Jun 27, 2022
2 parents 6c02299 + 43c1e96 commit 88e86f1
Show file tree
Hide file tree
Showing 16 changed files with 326 additions and 267 deletions.
8 changes: 1 addition & 7 deletions src/core/adaptive/adaptive_representation_selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,8 @@ function getEstimateReference(
*/
const guessBasedChooser = new GuessBasedChooser(scoreCalculator, prevEstimate);

let lastPlaybackObservation : IRepresentationEstimatorPlaybackObservation;

// get initial observation for initial estimate
const unregisterInitial = playbackObserver.listen(obs => {
lastPlaybackObservation = obs;
}, { includeLastObservation: true });
unregisterInitial(); // The initial is emitted synchronously, we can now remove it
// TODO cleaner playbackObserver.getLast() or something?
let lastPlaybackObservation = playbackObserver.getReference().getValue();

/** Reference through which estimates are emitted. */
const innerEstimateRef = createSharedReference<IABREstimate>(getCurrentEstimate());
Expand Down
Loading

0 comments on commit 88e86f1

Please sign in to comment.