mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-23 12:01:01 +00:00
threadshare: make live sources return NoPreroll from PlayingToPaused
Not returning NoPreroll in that transition causes downstream sinks to wait for preroll forever. Reproduce with: gst-launch-1.0 audiotestsrc ! udpsink host=127.0.0.1 port=50000 gst-launch-1.0 ts-udpsrc address=127.0.0.1 port=50000 ! fakesink ctrl + C in the receiver pipeline -> hangs forever
This commit is contained in:
parent
92941d7f92
commit
decc1e2029
4 changed files with 19 additions and 4 deletions
|
@ -718,6 +718,9 @@ impl ElementImpl for AppSrc {
|
|||
runtime::executor::block_on(self.start(element))
|
||||
.map_err(|_| gst::StateChangeError)?;
|
||||
}
|
||||
gst::StateChange::PlayingToPaused => {
|
||||
success = gst::StateChangeSuccess::NoPreroll;
|
||||
}
|
||||
gst::StateChange::PausedToReady => {
|
||||
self.src_pad_handler
|
||||
.0
|
||||
|
|
|
@ -1373,13 +1373,19 @@ impl ElementImpl for JitterBuffer {
|
|||
_ => (),
|
||||
}
|
||||
|
||||
let mut ret = self.parent_change_state(element, transition)?;
|
||||
let mut success = self.parent_change_state(element, transition)?;
|
||||
|
||||
if transition == gst::StateChange::ReadyToPaused {
|
||||
ret = gst::StateChangeSuccess::NoPreroll;
|
||||
match transition {
|
||||
gst::StateChange::ReadyToPaused => {
|
||||
success = gst::StateChangeSuccess::NoPreroll;
|
||||
}
|
||||
gst::StateChange::PlayingToPaused => {
|
||||
success = gst::StateChangeSuccess::NoPreroll;
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
||||
Ok(ret)
|
||||
Ok(success)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1492,6 +1492,9 @@ impl ElementImpl for ProxySrc {
|
|||
runtime::executor::block_on(self.start(element))
|
||||
.map_err(|_| gst::StateChangeError)?;
|
||||
}
|
||||
gst::StateChange::PlayingToPaused => {
|
||||
success = gst::StateChangeSuccess::NoPreroll;
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
||||
|
|
|
@ -1157,6 +1157,9 @@ impl ElementImpl for UdpSrc {
|
|||
runtime::executor::block_on(self.start(element))
|
||||
.map_err(|_| gst::StateChangeError)?;
|
||||
}
|
||||
gst::StateChange::PlayingToPaused => {
|
||||
success = gst::StateChangeSuccess::NoPreroll;
|
||||
}
|
||||
gst::StateChange::PausedToReady => {
|
||||
self.src_pad_handler
|
||||
.0
|
||||
|
|
Loading…
Reference in a new issue