gst-player: How to seek

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

gst-player: How to seek

Jonathan Miles

Hello,


What's the correct way to perform a seek when using gst-player?


At the moment, after pausing playback when the UI start the seek, I'm calling gst_player_play() immediately after gst_player_seek() and appear to end up in an odd state where the player playing, but the player state is buffering:


[2016-09-14 14:16:53.815318]   GPLAY:  <>-[GStreamerPlayer vSeek:] self = 0x361a40 t=57
0:01:01.169877924  1955   0x30c9b0 DEBUG             gst-player gstplayer.c:3341:gst_player_seek_internal_locked:<player0> Seek with rate 1.00 to 0:00:57.000000000
[2016-09-14 14:16:53.826589]   GPLAY:  <>-[GStreamerPlayer vResumePlayback] self = 0x361a40
0:01:01.203182382  1955   0x30c9b0 DEBUG             gst-player gstplayer.c:2931:gst_player_play_internal:<player0> Play
0:01:01.207496882  1955   0x30c9b0 DEBUG             gst-player gstplayer.c:1606:state_changed_cb:<player0> Changed state old: PAUSED new: PAUSED pending: PAUSED
0:01:01.213627049  1955   0x30c9b0 DEBUG             gst-player gstplayer.c:911:change_state:<player0> Changing app state from paused to buffering
[2016-09-14 14:16:53.866358] GPLAYCB:    <>vStateChanged buffering
0:01:01.276247840  1955   0x30c9b0 DEBUG             gst-player gstplayer.c:1606:state_changed_cb:<player0> Changed state old: PAUSED new: PAUSED pending: PLAYING
0:01:01.408422257  1955   0x30c9b0 DEBUG             gst-player gstplayer.c:1606:state_changed_cb:<player0> Changed state old: PAUSED new: PLAYING pending: VOID_PENDING

Then, when you pause, the seek completes:

[2016-09-14 14:18:34.319064]   GPLAY:  <>-[GStreamerPlayer vPausePlayback] self = 0x361a40
0:02:41.673416977  1955   0x30c9b0 DEBUG             gst-player gstplayer.c:3047:gst_player_pause_internal:<player0> Pause
0:02:41.715190061  1955   0x30c9b0 DEBUG             gst-player gstplayer.c:1606:state_changed_cb:<player0> Changed state old: PLAYING new: PAUSED pending: VOID_PENDING
0:02:41.717461644  1955   0x30c9b0 DEBUG             gst-player gstplayer.c:1670:state_changed_cb:<player0> Seek finished
[2016-09-14 14:18:34.371081] GPLAYCB:<>vSeekDone 157250000000
[2016-09-14 14:18:34.374338] GPLAYCB:<>vPositionUpdated 157250000000
0:02:41.727308352  1955   0x30c9b0 DEBUG             gst-player gstplayer.c:911:change_state:<player0> Changing app state from buffering to paused
[2016-09-14 14:18:34.379079] GPLAYCB:<>vStateChanged paused

Does this mean I should be waiting for the 'seek-done' signal before trying to restart playback?

Thanks,

Jonathan



Audio Partnership PLC, Gallery Court, Hankey Place, London SE1 4BB, UK Reg No. 2953313 This e-mail is confidential and for the addressee only. Please refer to Disclaimer for important notices.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst-player: How to seek

Sebastian Dröge-3
On Mi, 2016-09-14 at 13:24 +0000, Jonathan Miles wrote:
> Hello,
>
> What's the correct way to perform a seek when using gst-player?

You should be able to seek at any moment

> [...]
> Does this mean I should be waiting for the 'seek-done' signal before
> trying to restart playback?

That means the state tracking in GstPlayer gets it wrong under these
circumstances because of the play() immediately after seek(). That
should be fixed.

Can you report a bug with a testcase for this?

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (985 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: gst-player: How to seek

Sebastian Dröge-3
On Mi, 2016-09-14 at 15:37 +0200, Sebastian Dröge wrote:


> > [...]
> > Does this mean I should be waiting for the 'seek-done' signal
> > before trying to restart playback?
>
> That means the state tracking in GstPlayer gets it wrong under these
> circumstances because of the play() immediately after seek(). That
> should be fixed.
>
> Can you report a bug with a testcase for this?
My guess is that we should not set the actual state in play() when a
seek is still pending, but only remember the (new) target state to be
actually set later after the seek is done.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (985 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: gst-player: How to seek

Sebastian Dröge-3
On Mi, 2016-09-14 at 15:59 +0200, Sebastian Dröge wrote:

> On Mi, 2016-09-14 at 15:37 +0200, Sebastian Dröge wrote:
> >
> >  
> > >
> > > [...]
> > > Does this mean I should be waiting for the 'seek-done' signal
> > > before trying to restart playback?
> >
> > That means the state tracking in GstPlayer gets it wrong under
> > these
> > circumstances because of the play() immediately after seek(). That
> > should be fixed.
> >
> > Can you report a bug with a testcase for this?
>
> My guess is that we should not set the actual state in play() when a
> seek is still pending, but only remember the (new) target state to be
> actually set later after the seek is done.
Yes, this should fix it:
  http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=a036b7ef9ffe9fe5dac4a7e46fbc3bac92921a54

Please confirm, or otherwise file a bug :)

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (985 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: gst-player: How to seek

Jonathan Miles

On 14 September 2016 17:09, Sebastian Dröge <[hidden email]> wrote:
>> [...]
>>  
>> My guess is that we should not set the actual state in play() when a
>> seek is still pending, but only remember the (new) target state to be
>> actually set later after the seek is done.
> Yes, this should fix it:
>   http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=a036b7ef9ffe9fe5dac4a7e46fbc3bac92921a54
> Please confirm, or otherwise file a bug :)

That does the trick. Thank you!

Jonathan



Audio Partnership PLC, Gallery Court, Hankey Place, London SE1 4BB, UK Reg No. 2953313 This e-mail is confidential and for the addressee only. Please refer to Disclaimer for important notices.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel