Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 07c68b6

Browse files
committed
Bug 1446538 - Update mp4parse-rust to ded91a16. r=SimonSapin
Qualify calls to our FallibleVec trait to avoid clashes with new additions to nightly libstd. MozReview-Commit-ID: dNwuVIYJe --HG-- extra : rebase_source : d9d64c18c89ec5f1ea0993045dd180239a63c210
1 parent 33d6f80 commit 07c68b6

5 files changed

Lines changed: 14 additions & 9 deletions

File tree

media/mp4parse-rust/mp4parse-cargo.patch

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ diff --git a/media/libstagefright/binding/mp4parse_capi/Cargo.toml b/media/libst
2828
index a30e045..a965f06 100644
2929
--- a/media/libstagefright/binding/mp4parse_capi/Cargo.toml
3030
+++ b/media/libstagefright/binding/mp4parse_capi/Cargo.toml
31-
@@ -18,22 +18,13 @@
31+
@@ -18,23 +18,16 @@
3232
"*.mp4",
3333
]
3434

@@ -38,18 +38,20 @@ index a30e045..a965f06 100644
3838

3939
[dependencies]
4040
byteorder = "1.2.1"
41-
-env_logger = "0.5.3"
4241
log = "0.4"
4342

4443
# To enable fallible memory allocation, add 'features = ["mp4parse_fallible"]'
4544
# in mp4parse brace.
4645
-mp4parse = {version = "0.10.0", path = "../mp4parse"}
4746
+mp4parse = {version = "0.10.0", path = "../mp4parse", features = ["mp4parse_fallible"]}
4847
num-traits = "0.2.0"
48+
49+
[dev-dependencies]
50+
env_logger = "0.5.3"
4951
-
5052
-[build-dependencies]
51-
-cbindgen = "0.4.3"
53+
-cbindgen = "0.5.2"
5254
-
5355
-[features]
5456
-fuzz = ["mp4parse/fuzz"]
55-
-
57+

media/mp4parse-rust/mp4parse.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ typedef struct {
105105
} Mp4parseTrackVideoInfo;
106106

107107
typedef struct {
108-
intptr_t (*read)(uint8_t*, size_t, void*);
108+
intptr_t (*read)(uint8_t*, uintptr_t, void*);
109109
void *userdata;
110110
} Mp4parseIo;
111111

media/mp4parse-rust/mp4parse/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const TABLE_SIZE_LIMIT: u32 = 30 * 60 * 60 * 24 * 7;
4545
pub fn vec_push<T>(vec: &mut Vec<T>, val: T) -> std::result::Result<(), ()> {
4646
#[cfg(feature = "mp4parse_fallible")]
4747
{
48-
return vec.try_push(val);
48+
return FallibleVec::try_push(vec, val);
4949
}
5050

5151
vec.push(val);
@@ -56,7 +56,7 @@ pub fn vec_push<T>(vec: &mut Vec<T>, val: T) -> std::result::Result<(), ()> {
5656
pub fn vec_reserve<T>(vec: &mut Vec<T>, size: usize) -> std::result::Result<(), ()> {
5757
#[cfg(feature = "mp4parse_fallible")]
5858
{
59-
return vec.try_reserve(size);
59+
return FallibleVec::try_reserve(vec, size);
6060
}
6161

6262
vec.reserve(size);
@@ -68,7 +68,7 @@ fn allocate_read_buf(size: usize) -> std::result::Result<Vec<u8>, ()> {
6868
#[cfg(feature = "mp4parse_fallible")]
6969
{
7070
let mut buf: Vec<u8> = Vec::new();
71-
buf.try_reserve(size)?;
71+
FallibleVec::try_reserve(&mut buf, size)?;
7272
unsafe { buf.set_len(size); }
7373
return Ok(buf);
7474
}

media/mp4parse-rust/mp4parse_capi/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ log = "0.4"
2828
# in mp4parse brace.
2929
mp4parse = {version = "0.10.0", path = "../mp4parse", features = ["mp4parse_fallible"]}
3030
num-traits = "0.2.0"
31+
32+
[dev-dependencies]
33+
env_logger = "0.5.3"

media/mp4parse-rust/update-rust.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Script to update mp4parse-rust sources to latest upstream
33

44
# Default version.
5-
VER="v0.10.0"
5+
VER="ded91a1661daaf55515e572aadd8e92e6d71cbaf"
66

77
# Accept version or commit from the command line.
88
if test -n "$1"; then

0 commit comments

Comments
 (0)