View Single Post
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#103
Originally Posted by pycage View Post
May I ask what the reason for the segfault was?
I hope it didn't come from my MAFW code.
Everyone say hi to the genius behind the MAFW bindings . Your code rocks dude .

To the question: Yes, and then also No .

I don't blame your code at all. I had the same problem with python's gstreamer bindings. I think the culprit is gobject.

It doesn't know how to properly communicate over the QT4 main UI loop. You don't have this problem because you use GTK and gtk.main(), but with qt4 using gstreamer (and yours) I required this code:

Code:
loop = gobject.MainLoop()
gobject.threads_init()
context = loop.get_context()
It's somewhat annoying because I'm an all QT app but have to have a gobject MainLoop running. I already had this code, as I said, from the gstreamer problem - but I was still running into issues with your MAFWBackend. I thought maybe I didn't need it anymore and found it would segfault every time I loaded an audio file after I removed it.. so I knew it had something to do with it.

I ended up putting it into the init function of MAFWBackend... works every time now. So it was just the placement of it that was causing issues. My biggest gripe ATM is that I kinda wish we could make these backends into modules.. as it is if someone uses MediaBox and pyRadio they will have 4 copies of (almost) identical files. Just seems like a waste of space.

But, for now I'd like to figure out your EventEmitter system here so I can connect my own methods to the on_eof and the position_cb methods.. so that I can receive events/signals when a file is done playing and every second to make my new countdown timer more accurate.
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 

The Following User Says Thank You to fatalsaint For This Useful Post: