mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-03 13:53:53 +02:00
Fix incorrect VideoSample dimensions
This commit is contained in:
+5
-2
@@ -143,8 +143,11 @@ export class VideoSample {
|
|||||||
this._data = data;
|
this._data = data;
|
||||||
|
|
||||||
this.format = data.format;
|
this.format = data.format;
|
||||||
this.codedWidth = data.codedWidth;
|
// Copying the display dimensions here, assuming no innate VideoFrame rotation
|
||||||
this.codedHeight = data.codedHeight;
|
this.codedWidth = data.displayWidth;
|
||||||
|
this.codedHeight = data.displayHeight;
|
||||||
|
// The VideoFrame's rotation is ignored here. It's still a new field, and I'm not sure of any application
|
||||||
|
// where the browser makes use of it. If a case gets found, I'll add it.
|
||||||
this.rotation = init?.rotation ?? 0;
|
this.rotation = init?.rotation ?? 0;
|
||||||
this.timestamp = init?.timestamp ?? data.timestamp / 1e6;
|
this.timestamp = init?.timestamp ?? data.timestamp / 1e6;
|
||||||
this.duration = init?.duration ?? (data.duration ?? 0) / 1e6;
|
this.duration = init?.duration ?? (data.duration ?? 0) / 1e6;
|
||||||
|
|||||||
+1
-1
@@ -491,7 +491,7 @@ export class FilePathSource extends Source {
|
|||||||
this._streamSource = new StreamSource({
|
this._streamSource = new StreamSource({
|
||||||
getSize: async () => {
|
getSize: async () => {
|
||||||
const FS_MODULE_NAME = 'node:fs/promises';
|
const FS_MODULE_NAME = 'node:fs/promises';
|
||||||
const fs = await import(FS_MODULE_NAME) as typeof import('node:fs/promises');
|
const fs = await import(/* @vite-ignore */ FS_MODULE_NAME) as typeof import('node:fs/promises');
|
||||||
fileHandle = await fs.open(filePath, 'r');
|
fileHandle = await fs.open(filePath, 'r');
|
||||||
|
|
||||||
const stats = await fileHandle.stat();
|
const stats = await fileHandle.stat();
|
||||||
|
|||||||
Reference in New Issue
Block a user