mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Remove readBitsLong, use readBits instead
This commit is contained in:
parent
dd7a796883
commit
d03fb10516
2 changed files with 4 additions and 14 deletions
|
|
@ -532,11 +532,11 @@ public final class TsExtractor implements Extractor, SeekMap {
|
||||||
timeUs = 0;
|
timeUs = 0;
|
||||||
if (ptsFlag) {
|
if (ptsFlag) {
|
||||||
pesScratch.skipBits(4); // '0010'
|
pesScratch.skipBits(4); // '0010'
|
||||||
long pts = pesScratch.readBitsLong(3) << 30;
|
long pts = (long) pesScratch.readBits(3) << 30;
|
||||||
pesScratch.skipBits(1); // marker_bit
|
pesScratch.skipBits(1); // marker_bit
|
||||||
pts |= pesScratch.readBitsLong(15) << 15;
|
pts |= pesScratch.readBits(15) << 15;
|
||||||
pesScratch.skipBits(1); // marker_bit
|
pesScratch.skipBits(1); // marker_bit
|
||||||
pts |= pesScratch.readBitsLong(15);
|
pts |= pesScratch.readBits(15);
|
||||||
pesScratch.skipBits(1); // marker_bit
|
pesScratch.skipBits(1); // marker_bit
|
||||||
timeUs = ptsToTimeUs(pts);
|
timeUs = ptsToTimeUs(pts);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,21 +99,11 @@ public final class ParsableBitArray {
|
||||||
* @return An integer whose bottom n bits hold the read data.
|
* @return An integer whose bottom n bits hold the read data.
|
||||||
*/
|
*/
|
||||||
public int readBits(int n) {
|
public int readBits(int n) {
|
||||||
return (int) readBitsLong(n);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reads up to 64 bits.
|
|
||||||
*
|
|
||||||
* @param n The number of bits to read.
|
|
||||||
* @return A long whose bottom n bits hold the read data.
|
|
||||||
*/
|
|
||||||
public long readBitsLong(int n) {
|
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
long retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
// While n >= 8, read whole bytes.
|
// While n >= 8, read whole bytes.
|
||||||
while (n >= 8) {
|
while (n >= 8) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue