Skip to content

Commit 67935bc

Browse files
committed
don't wait on terminated thread
1 parent 3b21581 commit 67935bc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

jni/libmediaplayer/decoder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void IDecoder::stop()
3535
__android_log_print(ANDROID_LOG_INFO, TAG, "waiting on end of decoder thread");
3636
int ret = -1;
3737
if((ret = wait()) != 0) {
38-
__android_log_print(ANDROID_LOG_ERROR, TAG, "Couldn't cancel audio IDecoder: %i", ret);
38+
__android_log_print(ANDROID_LOG_ERROR, TAG, "Couldn't cancel IDecoder: %i", ret);
3939
return;
4040
}
4141
}

jni/libmediaplayer/thread.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ void Thread::startAsync()
1515

1616
int Thread::wait()
1717
{
18+
if(!mRunning)
19+
{
20+
return 0;
21+
}
1822
return pthread_join(mThread, NULL);
1923
}
2024

0 commit comments

Comments
 (0)