@@ 243,11 243,10 @@ matroskarun(Biobuf *f)
if(off >= bgend && !skipdata){
if(npackets > 0){
- if(te.fpacket(&out, &te, packets, npackets, ts, key || refblock) != 0)
+ if(te.fpacket(&out, &te, packets, npackets, ts, key || !refblock) != 0)
goto err;
npackets = 0;
}
- refblock = 0;
}
n = ebmlel(f, left, &el, &sz);
@@ 311,7 310,7 @@ matroskarun(Biobuf *f)
continue;
}else if(el.id == EBlockGroup && !skipdata){
refblock = 0;
- bgend = off+sz;
+ bgend = off+n+sz;
npackets = 0;
continue;
}else if((el.id == ESimpleBlock || el.id == EBlock) && !skipdata){