mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-03-09 15:01:41 +00:00
awstranscriber2: fix initial position
Wait until we have received a first buffer before pushing gaps on timeout, as we don't have a valid start time before that. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2072>
This commit is contained in:
parent
d0db66d61e
commit
6b9e3fd772
1 changed files with 7 additions and 1 deletions
|
@ -329,7 +329,9 @@ impl Transcriber {
|
|||
if let Some(upstream_latency) = upstream_latency {
|
||||
let (upstream_live, upstream_min, _) = upstream_latency;
|
||||
|
||||
if upstream_live {
|
||||
// Don't push a gap before we've even received a first buffer,
|
||||
// as we haven't set in_segment.position to a start time yet
|
||||
if upstream_live && state.last_input_rtime.is_some() {
|
||||
if let Some(now) = now {
|
||||
let seqnum = state.seqnum;
|
||||
let in_segment = state.in_segment.as_mut().unwrap();
|
||||
|
@ -603,6 +605,10 @@ impl Transcriber {
|
|||
|
||||
gst::trace!(CAT, imp = self, "storing last input running time {rtime}");
|
||||
|
||||
if state.last_input_rtime.is_none() {
|
||||
state.in_segment.as_mut().unwrap().set_position(Some(pts));
|
||||
}
|
||||
|
||||
state.last_input_rtime = Some(rtime);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue