Bug 1242807 - Fix mp4parse-rust's error reporting via telemetry. r=giles

This commit is contained in:
Matthew Gregan 2016-01-26 14:27:35 +13:00
parent 33f6bafc2c
commit c5aae23c29
2 changed files with 2 additions and 2 deletions

View File

@ -112,7 +112,7 @@ MP4Metadata::~MP4Metadata()
#ifdef MOZ_RUST_MP4PARSE
// Helper to test the rust parser on a data source.
static bool try_rust(const UniquePtr<mp4parse_state, FreeMP4ParseState>& aRustState, RefPtr<Stream> aSource)
static int32_t try_rust(const UniquePtr<mp4parse_state, FreeMP4ParseState>& aRustState, RefPtr<Stream> aSource)
{
static LazyLogModule sLog("MP4Metadata");
int64_t length;

View File

@ -124,7 +124,7 @@ pub unsafe extern "C" fn mp4parse_read(context: *mut MediaContext, buffer: *cons
// result in an Ok(..) otherwise, meaning we could see
// Ok(Err(Error::..)) here. So map thread failures back
// to an mp4parse::Error before converting to a C return value.
match task.join().or(Err(Error::AssertCaught)) {
match task.join().unwrap_or(Err(Error::AssertCaught)) {
Ok(_) => MP4PARSE_OK,
Err(Error::InvalidData) => MP4PARSE_ERROR_INVALID,
Err(Error::Unsupported) => MP4PARSE_ERROR_UNSUPPORTED,