add: if (type == MEDIA_TYPE_ERROR && *error != NULL) return type;
context: totem_cd_detect_type_with_url (const char *device,    			       char      **url,			       GError     **error){  CdCache *cache;  MediaType type;  if (url != NULL)    *url = NULL;  if (!(cache = cd_cache_new (device, error)))    return MEDIA_TYPE_ERROR;  type = cd_cache_disc_is_cdda (cache, error);  if ((type == MEDIA_TYPE_DATA || type == MEDIA_TYPE_ERROR) &&      (type = cd_cache_disc_is_vcd (cache, error)) == MEDIA_TYPE_DATA &&      (type = cd_cache_disc_is_dvd (cache, error)) == MEDIA_TYPE_DATA) {    /* crap, nothing found */  }  if (url == NULL) {    cd_cache_free (cache);    return type;  }  switch (type) {  case MEDIA_TYPE_DVD:    *url = totem_cd_mrl_from_type ("dvd", device);    break;  case MEDIA_TYPE_VCD:    *url = totem_cd_mrl_from_type ("vcd", device);    break;  case MEDIA_TYPE_CDDA:    *url = totem_cd_mrl_from_type ("cdda", device);    break;  case MEDIA_TYPE_DATA:    *url = g_strdup (cache->mountpoint);    break;  default:    break;  }  cd_cache_free (cache);  return type;}