Skip to content

Commit

Permalink
fix timebase default value from upstream
Browse files Browse the repository at this point in the history
closes #6
  • Loading branch information
linnaea committed Nov 1, 2024
1 parent 2a49bd6 commit 8cb0c7f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/libavjs-webcodecs-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@
pts = LibAV.i64tof64(packet.pts || 0, packet.ptshi || 0);
}
// Get the appropriate time base
let tbNum = packet.time_base_num || 1;
let tbDen = packet.time_base_den || 1000000;
let tbNum = packet.time_base_num || 0;
let tbDen = packet.time_base_den || 1;
if (!tbNum) {
if (timeBaseSrc.length) {
const timeBase = timeBaseSrc;
Expand Down Expand Up @@ -997,7 +997,7 @@
let transfer = [];
let timeBase = opts.timeBase;
if (!timeBase && frame.time_base_num)
timeBase = [frame.time_base_num || 1, frame.time_base_den || 1000000];
timeBase = [frame.time_base_num || 0, frame.time_base_den || 1];
if (frame.layout) {
// Modern (libav.js ≥ 5) frame in WebCodecs-like format
data = frame.data;
Expand Down Expand Up @@ -1079,7 +1079,7 @@
AD = AudioData;
let timeBase = opts.timeBase;
if (!timeBase && frame.time_base_num)
timeBase = [frame.time_base_num || 1, frame.time_base_den || 1000000];
timeBase = [frame.time_base_num || 0, frame.time_base_den || 1];
// Combine all the frame data into a single object
let size = 0;
if (frame.data.buffer) {
Expand Down

0 comments on commit 8cb0c7f

Please sign in to comment.