Round down audio timestamps in PES packets, instead of rounding to nearest. Fixes HLS in Firefox.
This commit is contained in:
parent
ecee86bb1b
commit
10be747522
1 changed files with 4 additions and 6 deletions
|
@ -155,12 +155,10 @@ namespace Mist{
|
||||||
// Make sure TS timestamp is sample-aligned, if possible
|
// Make sure TS timestamp is sample-aligned, if possible
|
||||||
uint32_t freq = M.getRate(thisIdx);
|
uint32_t freq = M.getRate(thisIdx);
|
||||||
if (freq){
|
if (freq){
|
||||||
uint64_t aacSamples = (packTime / 90) * freq / 1000;
|
uint64_t aacSamples = packTime * freq / 90000;
|
||||||
// round to nearest packet, assuming all 1024 samples (probably wrong, but meh)
|
//round to nearest packet, assuming all 1024 samples (probably wrong, but meh)
|
||||||
aacSamples += 512;
|
aacSamples &= ~0x3FF;
|
||||||
aacSamples /= 1024;
|
//Get closest 90kHz clock time to perfect sample alignment
|
||||||
aacSamples *= 1024;
|
|
||||||
// Get closest 90kHz clock time to perfect sample alignment
|
|
||||||
packTime = aacSamples * 90000 / freq;
|
packTime = aacSamples * 90000 / freq;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue