code: public boolean setEncodingConfiguration(EncodingConfiguration ec) {
      boolean changed = false;
      if(!isEncoding && ec != null) {//don't wait if we're already encoding.
        streamLock.lock();
        try {
          if(!isEncoding) {
            encodingConfig = ec;
            frame.registerConfiguration(ec);
            for(int i = 0; i < MAX_THREADED_FRAMES; i++)
              threadedFrames[i].registerConfiguration(ec);
            changed = true;
          }
        }finally {
          streamLock.unlock();
        }
      }
      return changed;
    }
docs: Set the encoding configuration to that specified. The given encoding
  configuration is not stored by this object, but instead copied. This
  is to prevent the alteration of the config during an encode process. This
  must not be called while an encodeSamples(...) is active, or while
  encoding threads are active. If using threaded mode, use a blocking-count
  of zero in t_encodeSamples(...)to ensure the underlying encoding threads
  have finished before calling this method.
  
  @param ec EncodingConfiguration to use.
  @return true if the configuration was altered; false if the configuration
  cannot be altered(such as if another thread is currently encoding).