mirror of
https://github.com/samsonjs/media.git
synced 2026-04-10 12:05:47 +00:00
PlayerTrackEmsgHandler: Release sample queue in release()
This change makes it clear the SampleQueue doesn't outlive the wrapping PlayerTrackEmsgHandler, and releases it from PlayerTrackEmsgHandler.release(). This change is a no-op because calling release() is the same as reset() in this case (the behavior only differs if a non-dummy DrmSessionManager is being used). PiperOrigin-RevId: 289416622
This commit is contained in:
parent
cebad350fa
commit
865e014877
1 changed files with 4 additions and 6 deletions
|
|
@ -196,8 +196,7 @@ public final class PlayerEmsgHandler implements Handler.Callback {
|
|||
|
||||
/** Returns a {@link TrackOutput} that emsg messages could be written to. */
|
||||
public PlayerTrackEmsgHandler newPlayerTrackEmsgHandler() {
|
||||
return new PlayerTrackEmsgHandler(
|
||||
new SampleQueue(allocator, DrmSessionManager.getDummyDrmSessionManager()));
|
||||
return new PlayerTrackEmsgHandler(allocator);
|
||||
}
|
||||
|
||||
/** Release this emsg handler. It should not be reused after this call. */
|
||||
|
|
@ -284,9 +283,8 @@ public final class PlayerEmsgHandler implements Handler.Callback {
|
|||
private final FormatHolder formatHolder;
|
||||
private final MetadataInputBuffer buffer;
|
||||
|
||||
/* package */ PlayerTrackEmsgHandler(SampleQueue sampleQueue) {
|
||||
this.sampleQueue = sampleQueue;
|
||||
|
||||
/* package */ PlayerTrackEmsgHandler(Allocator allocator) {
|
||||
this.sampleQueue = new SampleQueue(allocator, DrmSessionManager.getDummyDrmSessionManager());
|
||||
formatHolder = new FormatHolder();
|
||||
buffer = new MetadataInputBuffer();
|
||||
}
|
||||
|
|
@ -349,7 +347,7 @@ public final class PlayerEmsgHandler implements Handler.Callback {
|
|||
|
||||
/** Release this track emsg handler. It should not be reused after this call. */
|
||||
public void release() {
|
||||
sampleQueue.reset();
|
||||
sampleQueue.release();
|
||||
}
|
||||
|
||||
// Internal methods.
|
||||
|
|
|
|||
Loading…
Reference in a new issue