Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Very important information.

Name: Anonymous 2011-02-14 0:25

I just poo'd my britches.

Name: Anonymous 2011-02-14 0:30

sage this shits.

Name: Anonymous 2011-02-14 0:32

    byte[] body_data;    // unsigned char // bytes from packet bodies
    int body_storage;    // long //storage elements allocated
    int body_fill;        // long //elements stored; fill mark
    int body_returned;    // long //elements of fill returned
   
    int[] lacing_vals;        // The values that will go to the segment table
    long[] granule_vals;    // ogg_int64_t //granulepos values for headers. Not compact this way, but it is simple coupled to the lacing fifo
    int lacing_storage;        // long
    int lacing_fill;        // long
    int lacing_packet;        // long
    int lacing_returned;    // long

    byte[] header;        // unsigned char    header[282];      //working space for header encode
    int header_fill;

    int e_o_s;        //set when we have buffered the last packet in the logical bitstream
    int b_o_s;        //set after we've written the initial page of a logical bitstream
    int serialno;    // long
    int pageno;        // long
    long packetno;    // ogg_int64_t  // sequence number for decode; the framing knows where there's a hole in the data, but we need coupling so
                    // that the codec (which is in a seperate abstraction layer) also knows about the gap

    long granulepos;        // ogg_int64_t  


    public ogg_stream_state () {

        header = new byte[ 282 ];
    }

    public ogg_stream_state( int _serialno ) {
       
        header = new byte[ 282 ];
       
        body_storage = 16*1024;

        // body_data = _ogg_malloc(os->body_storage*sizeof(*os->body_data));
        body_data = new byte[ body_storage ];

        lacing_storage = 1024;
        lacing_vals = new int[ lacing_storage ];
        granule_vals = new long[ lacing_storage ];

        serialno = _serialno;
    }
   
    public int getSerialNo() {
        return serialno;
    }

    // Helpers for ogg_stream_encode; this keeps the structure and what's happening fairly clear
   
    public void _os_body_expand( int needed ) {
       
        if ( body_storage <= body_fill + needed ) {
           
            body_storage += (needed+1024);
           
            // body_data = _ogg_realloc(os->body_data,os->body_storage*sizeof(*os->body_data));
            byte[] temp = new byte[ body_storage ];
            System.arraycopy( body_data, 0, temp, 0, body_data.length );
            body_data = temp;
        }
    }

    public void _os_lacing_expand( int needed ) {
       
        if ( lacing_storage <= lacing_fill + needed ) {
           
            lacing_storage += (needed+32);
           
            // lacing_vals = _ogg_realloc(os->lacing_vals,os->lacing_storage*sizeof(*os->lacing_vals));
            int[] temp = new int[ lacing_storage ];
            System.arraycopy( lacing_vals, 0, temp, 0, lacing_vals.length );
            lacing_vals = temp;
           
            // granule_vals = _ogg_realloc(os->granule_vals,os->lacing_storage*sizeof(*os->granule_vals));
            long[] temp2 = new long[ lacing_storage ];
            System.arraycopy( granule_vals, 0, temp, 0, granule_vals.length );
            granule_vals = temp2;
      }
    }
   
    public boolean ogg_stream_packetin( ogg_packet op ) {
       
// OOP varaible lacing_vals renamed lacing_vals_local
        int lacing_vals_local = op.bytes/255+1;
        int i;
       
        if ( body_returned > 0 ) {
           
            /* advance packet data according to the body_returned pointer. We
             * had to keep it around to return a pointer into the buffer last call */
           
            body_fill -= body_returned;
            if ( body_fill > 0 ) {
                // memmove( body_data, body_data + body_returned, body_fill );
                System.arraycopy( body_data, body_returned, body_data, 0, body_fill );
            }
            body_returned = 0;
        }
       
        // make sure we have the buffer storage
        _os_body_expand( op.bytes );
        _os_lacing_expand( lacing_vals_local );
       
        /* Copy in the submitted packet.  Yes, the copy is a waste; this is
         * the liability of overly clean abstraction for the time being.  It
         * will actually be fairly easy to eliminate the extra copy in the future */
       
        // memcpy( body_data + body_fill, op.packet, op.bytes );

}

Name: Anonymous 2011-02-15 7:18

>>3
[code]
>>3
[/code]

Name: Anonymous 2011-02-18 19:56


Don't change these.
Name: Email:
Entire Thread Thread List