mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-09-01 01:03:47 +00:00
rtmp4gdepay2: fix condition while creating parser
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2489>
This commit is contained in:
parent
7d88c817c8
commit
c068f662b1
1 changed files with 8 additions and 7 deletions
|
@ -9,8 +9,8 @@ pub enum ModeError {
|
|||
#[error("sizelength & constantsize can't be both defined")]
|
||||
BothAuSizeLenAndConstantSize,
|
||||
|
||||
#[error("Neither sizelength nor constantsize are defined, need at least one of them")]
|
||||
NeitherAuSizeLenNorConstantSize,
|
||||
#[error("no AU length parameters defined: need sizelength, constantsize, or constantduration")]
|
||||
MissingAuLengthParameters,
|
||||
|
||||
#[error("indexlength > 0 but indexdeltalength not defined")]
|
||||
MandatoryIndexDeltaLength,
|
||||
|
@ -83,13 +83,14 @@ impl ModeConfig {
|
|||
|
||||
let size_len = Self::parse_int::<u8>(s, "sizelength")?;
|
||||
let constant_size = Self::parse_int::<u32>(s, "constantsize")?;
|
||||
let constant_duration = Self::parse_int::<u32>(s, "constantduration")?;
|
||||
|
||||
if size_len != 0 && constant_size != 0 {
|
||||
Err(BothAuSizeLenAndConstantSize)?;
|
||||
}
|
||||
|
||||
if size_len == 0 && constant_size == 0 {
|
||||
Err(NeitherAuSizeLenNorConstantSize)?;
|
||||
if size_len == 0 && constant_size == 0 && constant_duration == 0 {
|
||||
Err(MissingAuLengthParameters)?;
|
||||
}
|
||||
|
||||
// § 3.2.1
|
||||
|
@ -116,7 +117,7 @@ impl ModeConfig {
|
|||
stream_state_indication: Self::parse_int::<u8>(s, "streamstateindication")?,
|
||||
auxiliary_data_size_len: Self::parse_int::<u8>(s, "auxiliarydatasizelength")?,
|
||||
constant_size,
|
||||
constant_duration: Self::parse_int::<u32>(s, "constantduration")?,
|
||||
constant_duration,
|
||||
max_displacement: Self::parse_int::<u32>(s, "maxdisplacement")?,
|
||||
})
|
||||
}
|
||||
|
@ -161,8 +162,8 @@ impl ModeConfig {
|
|||
Err(BothAuSizeLenAndConstantSize)?;
|
||||
}
|
||||
|
||||
if self.size_len == 0 && self.constant_size == 0 {
|
||||
Err(NeitherAuSizeLenNorConstantSize)?;
|
||||
if self.size_len == 0 && self.constant_size == 0 && self.constant_duration == 0 {
|
||||
Err(MissingAuLengthParameters)?;
|
||||
}
|
||||
|
||||
if self.index_len > 0 && self.index_delta_len == 0 {
|
||||
|
|
Loading…
Reference in a new issue