mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-26 05:21:00 +00:00
tttocea608: only warn when we do drop characters
In roll-up mode, we drop out of the loop and warn when the 32nd character is reached, the warning is unnecessary when there were no characters left to loop on. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/499>
This commit is contained in:
parent
b92360db37
commit
61214b5788
1 changed files with 11 additions and 7 deletions
|
@ -676,7 +676,9 @@ impl TtToCea608 {
|
|||
}
|
||||
};
|
||||
|
||||
for c in text.chars() {
|
||||
let mut chars = text.chars().peekable();
|
||||
|
||||
while let Some(c) = chars.next() {
|
||||
if c == '\r' {
|
||||
continue;
|
||||
}
|
||||
|
@ -723,12 +725,14 @@ impl TtToCea608 {
|
|||
if col > 31 {
|
||||
match state.mode {
|
||||
Cea608Mode::PaintOn | Cea608Mode::PopOn => {
|
||||
gst_warning!(
|
||||
CAT,
|
||||
obj: element,
|
||||
"Dropping characters after 32nd column: {}",
|
||||
c
|
||||
);
|
||||
if chars.peek().is_some() {
|
||||
gst_warning!(
|
||||
CAT,
|
||||
obj: element,
|
||||
"Dropping characters after 32nd column: {}",
|
||||
c
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
Cea608Mode::RollUp2 | Cea608Mode::RollUp3 | Cea608Mode::RollUp4 => {
|
||||
|
|
Loading…
Reference in a new issue