Skip to content

Commit e1f6359

Browse files
rilliankinetiknz
authored andcommitted
Make FLACMetadataBlock(s) public.
Decoders generally need access to these to configure output, display metadata and so on. The block type should probably be an enum instead, but this will work for now.
1 parent b0e9ae7 commit e1f6359

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

mp4parse/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,16 +257,16 @@ pub struct VPxConfigBox {
257257
}
258258

259259
#[derive(Debug, Clone)]
260-
struct FLACMetadataBlock {
261-
block_type: u8,
262-
data: Vec<u8>,
260+
pub struct FLACMetadataBlock {
261+
pub block_type: u8,
262+
pub data: Vec<u8>,
263263
}
264264

265265
/// Represet a FLACSpecificBox 'dfLa'
266266
#[derive(Debug, Clone)]
267267
pub struct FLACSpecificBox {
268268
version: u8,
269-
blocks: Vec<FLACMetadataBlock>,
269+
pub blocks: Vec<FLACMetadataBlock>,
270270
}
271271

272272
#[derive(Debug, Clone)]

mp4parse/tests/public.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ fn public_api() {
7575
assert_eq!(esds.audio_sample_rate.unwrap(), 48000);
7676
"ES"
7777
}
78-
mp4::AudioCodecSpecific::FLACSpecificBox(_) => {
79-
// No public fields.
78+
mp4::AudioCodecSpecific::FLACSpecificBox(flac) => {
79+
assert!(flac.blocks.len() > 0);
80+
assert!(flac.blocks[0].data.len() > 0);
8081
"FLAC"
8182
}
8283
mp4::AudioCodecSpecific::OpusSpecificBox(opus) => {

0 commit comments

Comments
 (0)