mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-17 02:57:35 -05:00
Resolved issue that was causing audio to cycle between stereo channels
when audio decoding is sporadic/intermittent.
This commit is contained in:
@@ -27,7 +27,7 @@ public abstract class AudioOutput implements Listener<AudioPacket>
|
|||||||
protected LinkedTransferQueue<AudioPacket> mBuffer = new LinkedTransferQueue<>();
|
protected LinkedTransferQueue<AudioPacket> mBuffer = new LinkedTransferQueue<>();
|
||||||
protected ScheduledExecutorService mExecutorService;
|
protected ScheduledExecutorService mExecutorService;
|
||||||
protected boolean mCanProcessAudio;
|
protected boolean mCanProcessAudio;
|
||||||
protected long mLastBufferReceived;
|
protected long mLastActivity;
|
||||||
|
|
||||||
public void dispose()
|
public void dispose()
|
||||||
{
|
{
|
||||||
@@ -111,7 +111,7 @@ public abstract class AudioOutput implements Listener<AudioPacket>
|
|||||||
*/
|
*/
|
||||||
public long getLastBufferReceived()
|
public long getLastBufferReceived()
|
||||||
{
|
{
|
||||||
return mLastBufferReceived;
|
return mLastActivity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -119,7 +119,7 @@ public abstract class AudioOutput implements Listener<AudioPacket>
|
|||||||
{
|
{
|
||||||
if( mCanProcessAudio )
|
if( mCanProcessAudio )
|
||||||
{
|
{
|
||||||
mLastBufferReceived = System.currentTimeMillis();
|
mLastActivity = System.currentTimeMillis();
|
||||||
|
|
||||||
mBuffer.add( packet );
|
mBuffer.add( packet );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,6 +165,8 @@ public class MonoAudioOutput extends AudioOutput
|
|||||||
checkStart();
|
checkStart();
|
||||||
|
|
||||||
broadcast( packet.getAudioMetadata() );
|
broadcast( packet.getAudioMetadata() );
|
||||||
|
|
||||||
|
mLastActivity = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -190,6 +190,8 @@ public class StereoAudioOutput extends AudioOutput
|
|||||||
checkStart();
|
checkStart();
|
||||||
|
|
||||||
broadcast( packet.getAudioMetadata() );
|
broadcast( packet.getAudioMetadata() );
|
||||||
|
|
||||||
|
mLastActivity = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user