private void pack() throws IOException {
		// 4bits: MPEG version
		if((buf[curPos+4] & 0xf0) == 0x20) {		// '0010 xxxx'
			if(!needBytes(12))
				return;

			if (this.duration == 0) {
				/*
				 *  1-bit: marker_bit
				 * 22-bit: mux_rate
				 *  1-bit: marker_bit
				 */
				int mux_rate = (buf[curPos + 9] & 0x7f) << 16;
				mux_rate |= (buf[curPos + 10] & 0xff) << 8;
				mux_rate |= buf[curPos + 11] & 0xff;
				mux_rate >>= 1;
				this.duration = (int) (raf.length() / mux_rate / 50);
				System.out.printf("duration: %ds\n", duration);
			}

			mpegVersion = 1;
			skip(12);
		} else if((buf[curPos+4] & 0xf0) == 0x40) {	// '0100 xxxx'
			if(!needBytes(14))
				return;
			mpegVersion = 2;
			skip(14 + (buf[curPos+13] & 0x7));
		}
	}