mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-03 13:53:53 +02:00
Fix samples not being closed sometimes in conversion (closes #272)
This commit is contained in:
@@ -1162,6 +1162,7 @@ export class Conversion {
|
|||||||
|
|
||||||
for await (const sample of sink.samples(this._startTimestamp, this._endTimestamp)) {
|
for await (const sample of sink.samples(this._startTimestamp, this._endTimestamp)) {
|
||||||
if (this._canceled) {
|
if (this._canceled) {
|
||||||
|
sample.close();
|
||||||
lastSample?.close();
|
lastSample?.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1444,6 +1445,7 @@ export class Conversion {
|
|||||||
const sink = new AudioSampleSink(track);
|
const sink = new AudioSampleSink(track);
|
||||||
for await (const sample of sink.samples(undefined, this._endTimestamp)) {
|
for await (const sample of sink.samples(undefined, this._endTimestamp)) {
|
||||||
if (this._canceled) {
|
if (this._canceled) {
|
||||||
|
sample.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1554,6 +1556,7 @@ export class Conversion {
|
|||||||
|
|
||||||
for await (const sample of iterator) {
|
for await (const sample of iterator) {
|
||||||
if (this._canceled) {
|
if (this._canceled) {
|
||||||
|
sample.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user