コード例 #1
0
 public int fetchHeaders(final Info info, final Comment comment, final int[] serialno, Page page) {
   if (page == null) {
     page = new Page();
     final int retValue = this.getNextPage(page, this.m_chunkSize);
     if (retValue == -128) {
       return -128;
     }
     if (retValue < 0) {
       return -130;
     }
   }
   if (serialno != null) {
     serialno[0] = page.serialno();
   }
   this.m_oggStreamState.init(page.serialno());
   info.init();
   comment.init();
   final Packet packet = new Packet();
   int i = 0;
   while (i < 3) {
     this.m_oggStreamState.pagein(page);
     while (i < 3) {
       final int result = this.m_oggStreamState.packetout(packet);
       if (result == 0) {
         break;
       }
       if (result == -1) {
         info.clear();
         this.m_oggStreamState.clear();
         return -1;
       }
       if (info.synthesis_headerin(comment, packet) != 0) {
         info.clear();
         this.m_oggStreamState.clear();
         return -1;
       }
       ++i;
     }
     if (i < 3 && this.getNextPage(page, 1L) < 0) {
       info.clear();
       this.m_oggStreamState.clear();
       return -1;
     }
   }
   return 0;
 }
コード例 #2
0
 @Override
 public void reset() {
   if (!this.m_isReset) {
     if (this.m_vorbisStream.isSeekable()) {
       this.rawSeek(this.m_dataOffsets[0]);
     } else {
       this.m_oggStreamState.clear();
       this.m_block.clear();
       this.m_dspState.clear();
       if (this.m_info != null) {
         for (final Info info : this.m_info) {
           info.clear();
         }
       }
       this.m_oggSyncState.clear();
       try {
         if (this.m_vorbisStream != null) {
           this.m_vorbisStream.reset();
         }
       } catch (Exception e) {
         JOrbisStream.m_logger.error((Object) "Exception", (Throwable) e);
       }
       this.m_links = 0;
       this.m_offset = 0L;
       this.m_offsets = null;
       this.m_dataOffsets = null;
       this.m_serialnos = null;
       this.m_pcmLengths = null;
       this.m_info = null;
       this.m_comments = null;
       this.m_pcmOffset = 0L;
       this.m_decodeReady = false;
       this.m_currentSerialno = 0;
       this.m_currentLink = 0;
       this.initialize(this.m_vorbisStream);
     }
     this.m_isReset = true;
   }
 }