Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sdroege/gst-plugin-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--text/wrap/src/gsttextwrap/imp.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/text/wrap/src/gsttextwrap/imp.rs b/text/wrap/src/gsttextwrap/imp.rs
index 1820a92c..9578e582 100644
--- a/text/wrap/src/gsttextwrap/imp.rs
+++ b/text/wrap/src/gsttextwrap/imp.rs
@@ -176,8 +176,8 @@ impl TextWrap {
state.end_ts = None;
}
- let duration_per_word: gst::ClockTime =
- duration / data.split_whitespace().count() as u64;
+ let num_words = data.split_whitespace().count() as u64;
+ let duration_per_word = (num_words != 0).then(|| duration / num_words);
if state.start_ts.is_none() {
state.start_ts = buffer.pts();