Parsed: 112088

  private function CleanUp() {

    // remove possible empty keys
    $AVpossibleEmptyKeys = array('dataformat', 'bits_per_sample', 'encoder_options', 'streams', 'bitrate');
    foreach ($AVpossibleEmptyKeys as $dummy => $key) {
      if (empty($this->info['audio'][$key]) && isset($this->info['audio'][$key])) {
        unset($this->info['audio'][$key]);
      }
      if (empty($this->info['video'][$key]) && isset($this->info['video'][$key])) {
        unset($this->info['video'][$key]);
      }
    }

    // remove empty root keys
    if (!empty($this->info)) {
      foreach ($this->info as $key => $value) {
        if (empty($this->info[$key]) && ($this->info[$key] !== 0) && ($this->info[$key] !== '0')) {
          unset($this->info[$key]);
        }
      }
    }

    // remove meaningless entries from unknown-format files
    if (empty($this->info['fileformat'])) {
      if (isset($this->info['avdataoffset'])) {
        unset($this->info['avdataoffset']);
      }
      if (isset($this->info['avdataend'])) {
        unset($this->info['avdataend']);
      }
    }

    // remove possible duplicated identical entries
    if (!empty($this->info['error'])) {
      $this->info['error'] = array_values(array_unique($this->info['error']));
    }
    if (!empty($this->info['warning'])) {
      $this->info['warning'] = array_values(array_unique($this->info['warning']));
    }

    // remove "global variable" type keys
    unset($this->info['php_memory_limit']);

    return true;
  }