mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-25 13:01:07 +00:00
fmp4mux: Fix usage of first_sample_flags/default_sample_flags
Previously first_sample_flags was never used so if the first sample was a keyframe and all others not then each sample got its own flags.
This commit is contained in:
parent
51c7d0652e
commit
6edb188899
1 changed files with 8 additions and 2 deletions
|
@ -1624,12 +1624,11 @@ fn analyze_buffers(
|
||||||
let f = sample_flags_from_buffer(buffer, intra_only);
|
let f = sample_flags_from_buffer(buffer, intra_only);
|
||||||
if first_buffer_flags.is_none() {
|
if first_buffer_flags.is_none() {
|
||||||
first_buffer_flags = Some(f);
|
first_buffer_flags = Some(f);
|
||||||
|
} else {
|
||||||
flags = Some(f);
|
flags = Some(f);
|
||||||
} else if flags.is_none() {
|
|
||||||
if Some(f) != first_buffer_flags {
|
if Some(f) != first_buffer_flags {
|
||||||
tr_flags |= FIRST_SAMPLE_FLAGS_PRESENT;
|
tr_flags |= FIRST_SAMPLE_FLAGS_PRESENT;
|
||||||
}
|
}
|
||||||
flags = Some(f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if flags.is_some() && Some(f) != flags {
|
if flags.is_some() && Some(f) != flags {
|
||||||
|
@ -1686,6 +1685,13 @@ fn analyze_buffers(
|
||||||
duration = None;
|
duration = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If there is only a single buffer use its flags as default sample flags
|
||||||
|
// instead of first sample flags.
|
||||||
|
if flags.is_none() && first_buffer_flags.is_some() {
|
||||||
|
tr_flags &= !FIRST_SAMPLE_FLAGS_PRESENT;
|
||||||
|
flags = first_buffer_flags.take();
|
||||||
|
}
|
||||||
|
|
||||||
if (tr_flags & SAMPLE_FLAGS_PRESENT) == 0 {
|
if (tr_flags & SAMPLE_FLAGS_PRESENT) == 0 {
|
||||||
tf_flags |= DEFAULT_SAMPLE_FLAGS_PRESENT;
|
tf_flags |= DEFAULT_SAMPLE_FLAGS_PRESENT;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue