Skip to content

Commit

Permalink
Revert logging changes made for Android decoder error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
20kdc committed Dec 20, 2023
1 parent d9a8731 commit d3645fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
16 changes: 8 additions & 8 deletions alvr/client_core/src/platform/android/decoder.rs
Expand Up @@ -170,14 +170,14 @@ fn decoder_attempt_setup(
MediaCodec::from_decoder_type(&mime)
.ok_or(anyhow!("unable to find decoder for mime type: {}", &mime))?
};
decoder
.configure(
&format,
Some(&image_reader.window()?),
MediaCodecDirection::Decoder,
)
.with_context(|| "failed to configure decoder")?;
decoder.start().with_context(|| "failed to start decoder")?;
let decoder_configure_err = decoder.configure(
&format,
Some(&image_reader.window()?),
MediaCodecDirection::Decoder,
);
decoder_configure_err.with_context(|| format!("failed to configure decoder"))?;
let decoder_start_err = decoder.start();
decoder_start_err.with_context(|| format!("failed to start decoder"))?;
Ok(decoder)
}

Expand Down
5 changes: 2 additions & 3 deletions alvr/common/src/logging.rs
Expand Up @@ -128,12 +128,11 @@ pub fn show_e_blocking<E: Display>(e: E) {
}

pub fn show_err<T, E: Display>(res: Result<T, E>) -> Option<T> {
res.map_err(|e| show_e_block(format!("{:#}", e), false))
.ok()
res.map_err(|e| show_e_block(e, false)).ok()
}

pub fn show_err_blocking<T, E: Display>(res: Result<T, E>) -> Option<T> {
res.map_err(|e| show_e_block(format!("{:#}", e), true)).ok()
res.map_err(|e| show_e_block(e, true)).ok()
}

pub trait ToAny<T> {
Expand Down

0 comments on commit d3645fe

Please sign in to comment.