Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General code quality fix-2 #190

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/net/majorkernelpanic/streaming/MediaStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -329,18 +329,18 @@ protected void createSockets() throws IOException {

if (sPipeApi == PIPE_API_LS) {

final String LOCAL_ADDR = "net.majorkernelpanic.streaming-";
final String localAddr = "net.majorkernelpanic.streaming-";

for (int i=0;i<10;i++) {
try {
mSocketId = new Random().nextInt();
mLss = new LocalServerSocket(LOCAL_ADDR+mSocketId);
mLss = new LocalServerSocket(localAddr+mSocketId);
break;
} catch (IOException e1) {}
}

mReceiver = new LocalSocket();
mReceiver.connect( new LocalSocketAddress(LOCAL_ADDR+mSocketId));
mReceiver.connect( new LocalSocketAddress(localAddr+mSocketId));
mReceiver.setReceiveBufferSize(500000);
mReceiver.setSoTimeout(3000);
mSender = mLss.accept();
Expand Down
6 changes: 3 additions & 3 deletions src/net/majorkernelpanic/streaming/audio/AACStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ private void testADTS() throws IllegalStateException, IOException {
}
}

final String TESTFILE = Environment.getExternalStorageDirectory().getPath()+"/spydroid-test.adts";
final String testfile = Environment.getExternalStorageDirectory().getPath()+"/spydroid-test.adts";

if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
throw new IllegalStateException("No external storage or external storage not ready !");
Expand All @@ -320,7 +320,7 @@ private void testADTS() throws IllegalStateException, IOException {
mMediaRecorder.setAudioChannels(1);
mMediaRecorder.setAudioSamplingRate(mQuality.samplingRate);
mMediaRecorder.setAudioEncodingBitRate(mQuality.bitRate);
mMediaRecorder.setOutputFile(TESTFILE);
mMediaRecorder.setOutputFile(testfile);
mMediaRecorder.setMaxDuration(1000);
mMediaRecorder.prepare();
mMediaRecorder.start();
Expand All @@ -335,7 +335,7 @@ private void testADTS() throws IllegalStateException, IOException {
mMediaRecorder.release();
mMediaRecorder = null;

File file = new File(TESTFILE);
File file = new File(testfile);
RandomAccessFile raf = new RandomAccessFile(file, "r");

// ADTS packets start with a sync word: 12bits set to 1
Expand Down
6 changes: 3 additions & 3 deletions src/net/majorkernelpanic/streaming/gl/SurfaceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ private void eglSetup() {
checkEglError("eglCreateContext RGB888+recordable ES2");

// Configure context for OpenGL ES 2.0.
int[] attrib_list = {
int[] attribList2 = {
EGL14.EGL_CONTEXT_CLIENT_VERSION, 2,
EGL14.EGL_NONE
};

if (mEGLSharedContext == null) {
mEGLContext = EGL14.eglCreateContext(mEGLDisplay, configs[0], EGL14.EGL_NO_CONTEXT, attrib_list, 0);
mEGLContext = EGL14.eglCreateContext(mEGLDisplay, configs[0], EGL14.EGL_NO_CONTEXT, attribList2, 0);
} else {
mEGLContext = EGL14.eglCreateContext(mEGLDisplay, configs[0], mEGLSharedContext, attrib_list, 0);
mEGLContext = EGL14.eglCreateContext(mEGLDisplay, configs[0], mEGLSharedContext, attribList2, 0);
}
checkEglError("eglCreateContext");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class AMRNBPacketizer extends AbstractPacketizer implements Runnable {

public final static String TAG = "AMRNBPacketizer";

private final int AMR_HEADER_LENGTH = 6; // "#!AMR\n"
private final static int AMR_HEADER_LENGTH = 6; // "#!AMR\n"
private static final int AMR_FRAME_HEADER_LENGTH = 1; // Each frame has a short header
private static final int[] sFrameBits = {95, 103, 118, 134, 148, 159, 204, 244};
private int samplingRate = 8000;
Expand Down