media-converter: Query upstream duration if needed

CW-Bug-Id: #19516
This commit is contained in:
Andrew Eikum
2022-01-19 11:29:54 +02:00
committed by Arkadiusz Hiler
parent bfc4b2330d
commit 48196af449
+5 -1
View File
@@ -533,11 +533,15 @@ impl VideoConv {
let mut state = self.state.lock().unwrap();
let state = match &mut *state {
let mut state = match &mut *state {
Some(s) => s,
None => { return Err(gst::FlowError::Error); }
};
if state.upstream_duration.is_none() {
self.query_upstream_duration(&mut state);
}
let ups_offset = self.duration_ours_to_upstream(&state, offset).unwrap();
let ups_requested_size = self.duration_ours_to_upstream(&state, requested_size as u64).unwrap() as u32;