Handle InterruptedException by Thread.interrupt()

Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
camera2
Leo Ma 9 years ago
parent 2b83e5656d
commit 236636ca74

@ -191,9 +191,8 @@ public class SrsRtmp {
try {
worker.join();
} catch (InterruptedException e) {
Log.i(TAG, "worker: join thread failed.");
e.printStackTrace();
worker.stop();
worker.interrupt();
}
worker = null;
publisher = null;

@ -64,6 +64,7 @@ public class ReadThread extends Thread {
Thread.getDefaultUncaughtExceptionHandler().uncaughtException(this, ioe);
} catch (InterruptedException ie) {
ie.printStackTrace();
this.interrupt();
}
}
// Close inputstream

@ -394,6 +394,7 @@ public class RtmpConnection implements RtmpPublisher, PacketRxHandler, ThreadCon
thread.join();
} catch (InterruptedException ie) {
ie.printStackTrace();
thread.interrupt();
}
}
}
@ -442,4 +443,4 @@ public class RtmpConnection implements RtmpPublisher, PacketRxHandler, ThreadCon
audio.getHeader().setAbsoluteTimestamp(dts);
writeThread.send(audio);
}
}
}
Loading…
Cancel
Save