2121 *
2222 */
2323public class VideoReader {
24- long pt = 0 ;
24+ int pt = 0 ;
2525 String blockType ;
2626 int blockLen ;
2727 byte [] buf = new byte [10 ];
@@ -81,7 +81,7 @@ public List<Map<String, Object>> getContents(boolean verbose) {
8181 }
8282
8383 protected void readBlock (List <Map <String , Object >> contents ) throws IOException {
84- long pt = this .pt ;
84+ int pt = this .pt ;
8585 blockLen = readInt ();
8686 blockType = readString (4 );
8787 if (verbose )
@@ -151,7 +151,7 @@ protected int readInner(int len, Map<String, Object> map) throws IOException {
151151 List <Map <String , Object >> list = new ArrayList <>();
152152 map .put ("blocks" , list );
153153 while (len > 0 ) {
154- long p = pt ;
154+ int p = pt ;
155155 readBlock (list );
156156 len -= (pt - p );
157157 }
@@ -175,8 +175,8 @@ protected int readFTYP(int len, Map<String, Object> map) throws IOException {
175175
176176 protected int readMVHD (int len , Map <String , Object > map ) throws IOException {
177177 map .put ("version_flags" , readInt ());
178- map .put ("creationTime" , readIntLong ());
179- map .put ("modificationTime" , readIntLong ());
178+ map .put ("creationTime" , readUIntLong ());
179+ map .put ("modificationTime" , readUIntLong ());
180180 timeScale = readInt ();
181181 int dur = readInt ();
182182 map .put ("timeScale" , timeScale );
@@ -198,8 +198,8 @@ private void dumpMap(Map<String, Object> map, String name) {
198198
199199 protected int readTKHD (int len , Map <String , Object > map ) throws IOException {
200200 map .put ("version_flags" , readInt ());
201- map .put ("creationTime" , readIntLong ());
202- map .put ("modificationTime" , readIntLong ());
201+ map .put ("creationTime" , readUIntLong ());
202+ map .put ("modificationTime" , readUIntLong ());
203203 map .put ("trackID" , readInt ());
204204 readInt (); // reserved
205205 int dur = readInt ();
@@ -246,7 +246,7 @@ protected byte[] readBytes(int n) throws IOException {
246246 return buf ;
247247 }
248248
249- protected long readIntLong () throws IOException {
249+ protected long readUIntLong () throws IOException {
250250 pt += 4 ;
251251 return is .readInt () & 0xFFFFFFFFL ;
252252 }
0 commit comments