ref: b4007e735d619438ba3dde8e076bd0afaf1ac530
parent: 563ea27fccd832e41f3cdd00270cec3b08308e34
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Wed Feb 10 11:54:34 EST 2021
matroska: use temp variable for block timecode
--- a/matroska.c
+++ b/matroska.c
@@ -190,6 +190,7 @@
int isebml, npackets, i, skipdata, lacing;
uvlong ts, timestamp, timestampscale;
double duration;
+ s16int timecode;
uchar *buf, *b;
Ebml e, te;
Elspec el;
@@ -304,6 +305,7 @@
}
left -= sz;
sz -= 3;
+ timecode = buf[0]<<8 | buf[1];
lacing = (buf[2] >> 1) & 3;
npackets = buf[3]+1;
@@ -403,7 +405,7 @@
}
/* ns timestamp */
- ts = (timestamp + (s16int)(buf[0]<<8 | buf[1])) * timestampscale - te.codec.delay;
+ ts = (timestamp + timecode) * timestampscale - te.codec.delay;
if(te.fpacket(&out, &te, packets, npackets, ts) != 0)
goto err;
continue;