playbin produces two about-to-finish signals with ogg sound files
With an ogg sound file, the following program gets about-to-finish twice. A sound file with the same data but some other codec (wav, flac, mp3) results in only one.
`
import os
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GLib', '2.0')
from gi.repository import Gst, GLib
WORKING_DIR = os.path.dirname(os.path.abspath(__file__))
class PlayEngine:
def __init__(self):
Gst.init(None)
self.playbin = Gst.ElementFactory.make('playbin', None)
self.playbin.connect('about-to-finish', self.on_about_to_finish)
self.bus = self.playbin.get_bus()
self.bus.add_signal_watch()
self.bus.connect('message::eos', self.on_eos)
uri = 'file://' + os.path.join(WORKING_DIR, 'demo.ogg')
#uri = 'file://' + os.path.join(WORKING_DIR, 'demo.mp3')
self.playbin.set_property('uri', uri)
self.playbin.set_state(Gst.State.PLAYING)
self.loop = GLib.MainLoop()
self.loop.run()
def on_eos(self, bus, msg):
print('Quitting on eos')
self.playbin.set_state(Gst.State.NULL)
self.loop.quit()
def on_about_to_finish(self, playbin):
print('In on_about_to_finish')
play_engine = PlayEngine()
`
I am on Kubuntu 19.10 with plugins base 1.16.1-1.