See if we can switch to just plain old GStreamer timers for this.
I've been playing with figuring out how to make this work and so far figured out the following:
Most likely the set_appsrc variant is better in the sense that playback providers can stay clear of gstreamer internals and the likes. I would suggest that set_appsrc add a one off notify::source listener (i.e. returns False), this listener then sets up the format and stream-type and attaches a callback to the seek-data event. When the seek callback is called we need to call a method on the playback provider to make it seek, this needs to be seperate from the normal callback. An other option is to pass in the callback when set_appsrc is called.
Within this solution we might also want to look at storing the source when we get notified instead of looking it up each time and hoping it is still an appsrc. If we store i properly we can set it to None when appropriate and set it to a proper source only when we have an active appsrc. However, this is likely a separate bug.
I'm considering looking at this.
The above comments are still valid, and you don't have any partial code for this laying around?
https://gist.github.com/5e1451c53b05d4a5f16f has the demo app I created to play with this and figure out what is documented above, it also contains the latest work I did which was really just wiring in the seekable callback. Problem I ran into was really just deadlocks caused by get_state blocking for state change completion, when the state change can't complete without data flow. So most likely missing bit is really just figuring out where we shouldn't block, or block with a timeout and this will be done. But don't forget to test with both local and spotify :-)
Thanks! I got GStreamer time tracking and GStreamer-based pause/resume working. Got some issues with seek. Will continue tomorrow.
This was fixed with the merge of #289.