mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
gstplay: check whether stream is seekable before seeking when state change
If state is changing from playing to paused, and rate is reset to 1 which causes seek position is valid, current code will do seek for streams that are not seekable. So need to check whether stream is seekable before seeking. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7441>
This commit is contained in:
parent
9a87ce418b
commit
c3f86005de
1 changed files with 6 additions and 2 deletions
|
@ -1422,8 +1422,12 @@ state_changed_cb (G_GNUC_UNUSED GstBus * bus, GstMessage * msg,
|
|||
}
|
||||
|
||||
if (self->seek_position != GST_CLOCK_TIME_NONE) {
|
||||
GST_DEBUG_OBJECT (self, "Seeking now that we reached PAUSED state");
|
||||
gst_play_seek_internal_locked (self);
|
||||
if (!self->media_info->seekable) {
|
||||
GST_DEBUG_OBJECT (self, "Media is not seekable");
|
||||
} else {
|
||||
GST_DEBUG_OBJECT (self, "Seeking now that we reached PAUSED state");
|
||||
gst_play_seek_internal_locked (self);
|
||||
}
|
||||
g_mutex_unlock (&self->lock);
|
||||
} else if (!self->seek_pending) {
|
||||
g_mutex_unlock (&self->lock);
|
||||
|
|
Loading…
Reference in a new issue