Remove readBitsLong, use readBits instead

This commit is contained in:
Oliver Woodman 2015-05-19 14:02:40 +01:00
parent dd7a796883
commit d03fb10516
2 changed files with 4 additions and 14 deletions

View file

@ -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);
} }

View file

@ -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) {