Skip to content
Snippets Groups Projects
Commit c55ebea3 authored by Lyubomir Marinov's avatar Lyubomir Marinov
Browse files

Temporarily reverts to the PulseAudio Renderer implementation to a pre-r9718...

Temporarily reverts to the PulseAudio Renderer implementation to a pre-r9718 state to fix freezes reported by Vincent Lucas and Kertesz Laszlo on the dev mailing list while further looking into the cause of the problem.
parent c5c10074
No related branches found
No related tags found
No related merge requests found
......@@ -105,10 +105,24 @@ public void open()
}
}
/**
* Notifies this instance that the value of the
* {@link AudioSystem#PROP_PLAYBACK_DEVICE} property of its associated
* <tt>AudioSystem</tt> has changed. The default implementation does nothing
* so extenders may safely not call back to their
* <tt>AbstractAudioRenderer</tt> super.
*
* @param event a <tt>PropertyChangeEvent</tt> which specifies details about
* the change such as the name of the property and its old and new values
*/
protected void playbackDevicePropertyChange(PropertyChangeEvent event)
{
}
private void propertyChange(PropertyChangeEvent event)
{
if (AudioSystem.PROP_PLAYBACK_DEVICE.equals(event.getPropertyName()))
reset();
playbackDevicePropertyChange(event);
}
/**
......
......@@ -6,6 +6,7 @@
*/
package org.jitsi.impl.neomedia.jmfext.media.renderer.audio;
import java.beans.*;
import java.lang.reflect.*;
import java.util.*;
......@@ -467,6 +468,52 @@ private void doOpen()
}
}
/**
* Notifies this instance that the value of the
* {@link AudioSystem#PROP_PLAYBACK_DEVICE} property of its associated
* <tt>AudioSystem</tt> has changed.
*
* @param event a <tt>PropertyChangeEvent</tt> which specifies details about
* the change such as the name of the property and its old and new values
*/
@Override
protected void playbackDevicePropertyChange(PropertyChangeEvent event)
{
/*
* Stop, close, re-open and re-start this Renderer (performing whichever
* of these in order to bring it into the same state) in order to
* reflect the change in the selection with respect to the playback
* device.
*/
waitWhileStreamIsBusy();
boolean open = (this.stream != 0);
if (open)
{
/*
* The close method will stop this Renderer if it is currently
* started.
*/
boolean start = this.started;
close();
try
{
open();
}
catch (ResourceUnavailableException rue)
{
throw new UndeclaredThrowableException(rue);
}
if (start)
start();
}
}
/**
* Renders the audio data contained in a specific <tt>Buffer</tt> onto the
* PortAudio device represented by this <tt>Renderer</tt>.
......@@ -577,39 +624,6 @@ private void process(byte[] buffer, int offset, int length)
}
}
/**
* Resets the state of this <tt>PlugIn</tt>.
*/
public synchronized void reset()
{
waitWhileStreamIsBusy();
boolean open = (this.stream != 0);
if (open)
{
/*
* The close method will stop this Renderer if it is currently
* started.
*/
boolean start = this.started;
close();
try
{
open();
}
catch (ResourceUnavailableException rue)
{
throw new UndeclaredThrowableException(rue);
}
if (start)
start();
}
}
/**
* Sets the <tt>MediaLocator</tt> which specifies the device index of the
* PortAudio device to be used by this instance for rendering.
......
......@@ -6,6 +6,7 @@
*/
package org.jitsi.impl.neomedia.jmfext.media.renderer.audio;
import java.beans.*;
import java.io.*;
import java.lang.reflect.*;
......@@ -374,6 +375,55 @@ public void run()
}
}
/**
* Notifies this instance that the value of the
* {@link AudioSystem#PROP_PLAYBACK_DEVICE} property of its associated
* <tt>AudioSystem</tt> has changed.
*
* @param event a <tt>PropertyChangeEvent</tt> which specifies details about
* the change such as the name of the property and its old and new values
*/
@Override
protected void playbackDevicePropertyChange(PropertyChangeEvent event)
{
/*
* FIXME Disabled due to freezes reported by Vincent Lucas and Kertesz
* Laszlo on the dev mailing list.
*/
// pulseAudioSystem.lockMainloop();
// try
// {
// boolean open = (this.stream != 0);
//
// if (open)
// {
// /*
// * The close method will stop this Renderer if it is currently
// * started.
// */
// boolean start = !this.corked;
//
// close();
//
// try
// {
// open();
// }
// catch (ResourceUnavailableException rue)
// {
// throw new UndeclaredThrowableException(rue);
// }
//
// if (start)
// start();
// }
// }
// finally
// {
// pulseAudioSystem.unlockMainloop();
// }
}
public int process(Buffer buffer)
{
if (buffer.isDiscard())
......@@ -464,45 +514,6 @@ private int processWithMainloopLock(Buffer buffer)
return ret;
}
/**
* Resets the state of this <tt>PlugIn</tt>.
*/
public void reset()
{
pulseAudioSystem.lockMainloop();
try
{
boolean open = (this.stream != 0);
if (open)
{
/*
* The close method will stop this Renderer if it is currently
* started.
*/
boolean start = !this.corked;
close();
try
{
open();
}
catch (ResourceUnavailableException rue)
{
throw new UndeclaredThrowableException(rue);
}
if (start)
start();
}
}
finally
{
pulseAudioSystem.unlockMainloop();
}
}
private void setStreamVolume(long stream, float level)
{
int volume
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment