PrimaryAudioControl

You are here:

I'm having some problems with my JMF player instance on my bd-j disc. the disc contains several playlists, of which some have only one audio stream, some have two audio streams with German & English audio, and some have two streams with stereo & dolby.
so I want the video to change to the correct stream when selecting a playlist, e.g. when the audio is set to English instead of German (standard) or dolby instead of stereo (standard). I'm currently using two methods for this:

the problem is, the setDolby() method doesn't seem to work at all, when I'm using it, the whole BD-J application even seems to halt while the video keeps playing (I'm currently testing with Cyberlink PowerDVD).
The setAudioLanguage() method seems to work fine, up to the point when I'm selecting a video that hasn't any English stream, then the next video which should have an English stream automatically starts with the first (German) audio stream, although the language variable is still set to "English".
Is it possible that the listAvailableLanguages() method for PrimaryAudioControl lists the languages not only for the current playlist but for all available playlists? Then the error would make sense in some way... but how can I find out if the current playlist has two audio streams? I assume the listAvailableStreamNumbers() also does not only list the stream numbers of the current playlist but of all playlists.
Or do i have to get a new PrimaryAudioControl instance every time the JMF player changes its playlist? Or am I making some stupid mistake with the arrays "audioStreamIDs" and "languages"?
The setAudioLanguage() and setDolby() methods are called within a selectPlaylist() method, right after player.start().

Reply viewing options

A disclaimer: I haven't done this in practice, so I'm looking at this purely from the specification point of view,

JMF controls can be quite sensitive to two facts: whether the video is currently playing, and where exactly within the current video you are at the moment. Basically, the approach that is more or less guaranteed to work from the specification point of view would be to start a new video, to wait for StartEvent to be delivered, and only then to query available languages and audio stream numbers, perform selection etc. Perhaps, you could try this out and see if it helps.

hey thanks, the one with the StartEvent seems to help! Previously i used setDolby() and setAudioLanguage() right after player.start(), and that seemed to be the problem. Now i'm using the methods when my ControllerListener for the player receives a StartEvent and it works.
Regards,