Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #21 from jhlin/bug1114477
Browse files Browse the repository at this point in the history
Bug 1114477 - Stop source after thread stopped. r=mikeh
  • Loading branch information
rvandermeulen committed Jan 7, 2015
2 parents c976871 + 8d89e2f commit 8642b85
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions media/libstagefright/MPEG4Writer.cpp
Expand Up @@ -1783,13 +1783,16 @@ status_t MPEG4Writer::Track::stop() {
}
mDone = true;

ALOGD("%s track source stopping", mIsAudio? "Audio": "Video");
mSource->stop();
ALOGD("%s track source stopped", mIsAudio? "Audio": "Video");

void *dummy;
pthread_join(mThread, &dummy);
status_t err = static_cast<status_t>(reinterpret_cast<uintptr_t>(dummy));
ALOGD("Stopping %s track source", mIsAudio? "Audio": "Video");
{
status_t status = mSource->stop();
if (err == OK && status != OK && status != ERROR_END_OF_STREAM) {
err = status;
}
}

ALOGD("%s track stopped", mIsAudio? "Audio": "Video");
return err;
Expand Down

0 comments on commit 8642b85

Please sign in to comment.