code: public OggStreamAudioVisualData getNextAudioVisualPacket(Set<Integer> sids) throws IOException {
          OggStreamAudioVisualData data = null;
  
          while (data == null && !pendingPackets.isEmpty()) {
              AudioVisualDataAndSid avd = pendingPackets.removeFirst();
              if (sids == null || sids.contains(avd.sid)) {
                  data = avd.data;
              }
          }
  
          if (data == null) {
              OggPacket p = null;
              while ((p = r.getNextPacket()) != null) {
                  if (sids == null || sids.contains(p.getSid())) {
                      if (p.getSid() == sid) {
                          data = (OggStreamVideoData)TheoraPacketFactory.create(p);
                          break;
                      } else if (soundtracks.containsKey(p.getSid())) {
                          OggAudioStreamHeaders audio = soundtracks.get(p.getSid());
                          data = (OggStreamAudioData)audio.createAudio(p);
                          break;
                      } else {
                          // We don't know how to handle this stream
                          throw new IllegalArgumentException("Unsupported stream type with sid " + p.getSid());
                      }
                  } else {
                      // They're not interested in this stream
                      // Proceed on to the next packet
                  }
              }
          }
  
          return data;
      }
docs: Returns the next audio or video packet from any of
  the specified streams, or null if no more remain