mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-09-02 17:53:48 +00:00
awstranscriber2: fix PTS calculation with non-zero segment start
The time we get from AWS is a running time, and needs to be brought back to the segment time domain before comparison with segment position and usage as PTS. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2123>
This commit is contained in:
parent
1282593420
commit
4397b1e8e1
1 changed files with 17 additions and 1 deletions
|
@ -248,7 +248,23 @@ impl Transcriber {
|
|||
}
|
||||
}
|
||||
|
||||
let mut pts = aws_start_time + state.discont_accumulator + lateness;
|
||||
let rtime = aws_start_time + state.discont_accumulator + lateness;
|
||||
|
||||
let Some(mut pts) = state
|
||||
.in_segment
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.position_from_running_time(rtime)
|
||||
else {
|
||||
gst::warning!(
|
||||
CAT,
|
||||
imp = self,
|
||||
"received item with running time outside of segment ({})",
|
||||
rtime
|
||||
);
|
||||
continue;
|
||||
};
|
||||
|
||||
let duration = aws_end_time.saturating_sub(aws_start_time);
|
||||
|
||||
if let Some(position) = state.in_segment.as_ref().unwrap().position() {
|
||||
|
|
Loading…
Reference in a new issue