2 * Copyright (C) 2000 ymnk, JCraft,Inc.
4 * Written by: 2000 ymnk<ymnk@jcraft.com>
7 * Monty <monty@xiph.org> and
8 * The XIPHOPHORUS Company http://www.xiph.org/ .
9 * JOrbis has been based on their awesome works, Vorbis codec.
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public License
13 * as published by the Free Software Foundation; either version 2 of
14 * the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Library General Public License for more details.
21 * You should have received a copy of the GNU Library General Public
22 * License along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 package com.jcraft.jogg;
29 public byte[] packet_base;
35 public long granulepos;
37 public long packetno; // sequence number for decode; the framing
38 // knows where there's a hole in the data,
39 // but we need coupling so that the codec
40 // (which is in a seperate abstraction
41 // layer) also knows about the gap
45 static int sequence=0;
47 void checkpacket(int len, int no, int pos){
49 System.err.println("incorrect packet length!");
53 System.err.println("incorrect packet position!");
57 // packet number just follows sequence/gap; adjust the input number
68 if(packetno!=sequence){
69 System.err.println("incorrect packet sequence "+packetno+" != "+sequence);
74 for(int j=0;j<bytes;j++){
75 if((packet_base[packet+j]&0xff)!=((j+no)&0xff)){
76 System.err.println("body data mismatch at pos "+ j+": "+(packet_base[packet+j]&0xff)+"!="+((j+no)&0xff)+"!\n");