Commit d03fb105 by Oliver Woodman

Remove readBitsLong, use readBits instead

parent dd7a7968
...@@ -532,11 +532,11 @@ public final class TsExtractor implements Extractor, SeekMap { ...@@ -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 { ...@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment