mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-03 13:53:53 +02:00
0-duration VideoFrame
This commit is contained in:
+1
-1
@@ -418,7 +418,7 @@ export class CanvasSource extends VideoSource {
|
|||||||
|
|
||||||
const frame = new VideoFrame(this._canvas, {
|
const frame = new VideoFrame(this._canvas, {
|
||||||
timestamp: Math.round(1e6 * timestamp),
|
timestamp: Math.round(1e6 * timestamp),
|
||||||
duration: Math.round(1e6 * duration),
|
duration: Math.round(1e6 * duration) || undefined, // Drag 0 duration to undefined, glitches some codecs
|
||||||
alpha: 'discard',
|
alpha: 'discard',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -380,8 +380,8 @@ export const setVideoFrameTiming = (frame: VideoFrame, timing: {
|
|||||||
duration?: number;
|
duration?: number;
|
||||||
}) => {
|
}) => {
|
||||||
const clone = new VideoFrame(frame, {
|
const clone = new VideoFrame(frame, {
|
||||||
timestamp: timing.timestamp && 1e6 * timing.timestamp,
|
timestamp: timing.timestamp !== undefined ? 1e6 * timing.timestamp : undefined,
|
||||||
duration: timing.duration && 1e6 * timing.duration,
|
duration: timing.duration !== undefined ? 1e6 * timing.duration : undefined,
|
||||||
});
|
});
|
||||||
frame.close();
|
frame.close();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user