private int parseTimeStamps()
        throws MpegDecodeException, IOException
    {
        Statistics.startLog(PARSE_TIME_STAMPS);
        
        int pktLength = 0;
        long pts = -1, dts = -1;
        
        while( m_ioTool.nextBits( 0xFF, 8 ) )
        {
            m_ioTool.skipBits(8);
                pktLength++;
        }
        
        if( m_ioTool.nextBits(0x1, 2) )
        {
            m_ioTool.skipBits(16);
            pktLength += 2;
        }
        
        if( m_ioTool.nextBits(0x2, 4) )
        {
            m_ioTool.skipBits(4);
            pts = m_ioTool.getBits(3) << 30;
            m_ioTool.skipBits(1);
            pts |= m_ioTool.getBits(15) << 15;
            m_ioTool.skipBits(1);
            pts |= m_ioTool.getBits(15);
            m_ioTool.skipBits(1);
            pktLength += 5;
        }
        else if( m_ioTool.nextBits(0x3, 4 ) )
        {
            m_ioTool.skipBits(4);
            pts = m_ioTool.getBits(3) << 30;
            m_ioTool.skipBits(1);
            pts |= m_ioTool.getBits(15) << 15;
            m_ioTool.skipBits(1);
            pts |= m_ioTool.getBits(15);
            m_ioTool.skipBits(5);
            
            dts = m_ioTool.getBits(3) << 30;
            m_ioTool.skipBits(1);
            dts |= m_ioTool.getBits(15) << 15;
            m_ioTool.skipBits(1);
            dts |= m_ioTool.getBits(15);
            m_ioTool.skipBits(1);
            
            pktLength += 10;
        }
        else if( m_ioTool.getBits(8) != 0x0F )
        {
            Debug.println(Debug.ERROR, "Synchronization Error");
            throw new MpegDecodeException("Synchronization Error");
        }
        else
        {
            pktLength++;
        }

        pts = (pts > 0 ) ? ( pts / 90 ) : -1;
        if( m_lFirstVideoPTS == -1 )
        {
            m_lFirstVideoPTS = pts;
        }

        if( m_lFirstVideoPTS == -1 )
        {
            m_lFirstVideoPTS = pts;
        }

        m_lLastPTS = pts;

        Statistics.endLog(PARSE_TIME_STAMPS);
        
        return pktLength;
    }