/// Generate retry SC connection by combining all config elements. Returns error on failure.
Generate retry SC connection by combining all config elements. Returns error on failure.
Generate retry SC connection by combining all config elements . Returns error on failure .
fn make_sc_retry_ms(file_cfg: &Option<SpuConfigFile>) -> Result<u16, IoError> {
        let mut sc_retry_ms = None;
        // 1) environment variable (optional field, ignore errors)
        if let Ok(retry_ms_str) = env::var(FLV_SC_RETRY_TIMEOUT_MS) {
            let retry_ms = retry_ms_str.parse().map_err(|err| {
                IoError::new(ErrorKind::InvalidInput, format!("sc-retry-ms: {}", err))
            })?;
            sc_retry_ms = Some(retry_ms);
        }
        // 2) config file
        if sc_retry_ms.is_none() && file_cfg.is_some() {
            sc_retry_ms = file_cfg.as_ref().unwrap().sc_retry_ms();
        }
        // 3) unwrap or use default
        Ok(sc_retry_ms.unwrap_or(SPU_RETRY_SC_TIMEOUT_MS))
    }
fn make_sc_retry_ms ( file_cfg : & Option < SpuConfigFile > ) -> Result < u16 , IoError > { let mut sc_retry_ms = None ; // 1) environment variable (optional field, ignore errors) if let Ok ( retry_ms_str ) = env :: var ( FLV_SC_RETRY_TIMEOUT_MS ) { let retry_ms = retry_ms_str . parse ( ) . map_err ( | err | { IoError :: new ( ErrorKind :: InvalidInput , format ! ( " " err ) ) } ) ? ; sc_retry_ms = Some ( retry_ms ) ; } // 2) config file if sc_retry_ms . is_none ( ) && file_cfg . is_some ( ) { sc_retry_ms = file_cfg . as_ref ( ) . unwrap ( ) . sc_retry_ms ( ) ; } // 3) unwrap or use default Ok ( sc_retry_ms . unwrap_or ( SPU_RETRY_SC_TIMEOUT_MS ) ) }
Generate retry SC connection by combining all config elements.
Generate retry SC connection by combining all config elements .
file_cfg
&Option<SpuConfigFile>