What's the correct/approved method to communicate between threads?
#1
I'm working on EDL muting and as part of this I need to be able to do a one way communication from the DVDPlayer thread to the DVDPlayerAudio thread.

Currently I created a member variable that's part of DVDPlayerAudio that is modified by DVDPlayer (via a DVDPlayerAudio function I created). In the DVDPlayerAudio:Tonguerocess function I simply check if this variable has changed and do things accordingly. Is this the correct/approved method?

Or should I be sending some sort of message based on the DVDMsg class. A little confused still on the whole DVDMsg setup. If anyone can shed some light on this and let me know if I should be using it that would be much appreciated.

Thanks,
Harry
Reply
#2
Sending a message is usually the better way to go, yes. I'm not up on the DVDMsg architecture - I'm sure someone who is up with it will be along shortly.

You'll get into obvious problems if you're writing to and reading from the same variable in two threads.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
You should be sending a message. Your timings should be based on timestamps of the demux packets. When you get a packet with a timestamps where you want to mute, push a mute packet down the queue for the audio (it will then properly be delayed until that audio packet is processed).

Handle that mute request in dvdplayeraudio process queue.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#4
elupus Wrote:You should be sending a message. Your timings should be based on timestamps of the demux packets. When you get a packet with a timestamps where you want to mute, push a mute packet down the queue for the audio (it will then properly be delayed until that audio packet is processed).

Handle that mute request in dvdplayeraudio process queue.

Thanks, I think I'm finally getting the hang of the whole DVDMessage thing.

Thanks,
Harry
Reply

Logout Mark Read Team Forum Stats Members Help
What's the correct/approved method to communicate between threads?0