libeplayer3: speed up termination

This commit is contained in:
martii
2013-11-02 16:02:33 +01:00
parent 8df85c94e8
commit 539f41f46d
2 changed files with 8 additions and 2 deletions

View File

@@ -826,6 +826,9 @@ static void FFMPEGThread(Context_t *context) {
releaseMutex(FILENAME, __FUNCTION__,__LINE__); releaseMutex(FILENAME, __FUNCTION__,__LINE__);
} /* while */ } /* while */
if (context && context->playback && context->output && context->playback->abortRequested)
context->output->Command(context, OUTPUT_CLEAR, NULL);
if (swr) if (swr)
swr_free(&swr); swr_free(&swr);
if (decoded_frame) if (decoded_frame)

View File

@@ -116,7 +116,9 @@ status = 1;
while (!dieNow) while (!dieNow)
{ {
if (context && context->playback && context->playback->isPlaying) if (context && context->playback && context->playback->abortRequested)
dieNow = 1;
else if (context && context->playback && context->playback->isPlaying)
{ {
int ret = context->playback->Command(context, PLAYBACK_PTS, &playPts); int ret = context->playback->Command(context, PLAYBACK_PTS, &playPts);
@@ -125,7 +127,8 @@ status = 1;
if (ret != cERR_PLAYBACK_NO_ERROR || playPts + (2 * 90000) >= lastPts) if (ret != cERR_PLAYBACK_NO_ERROR || playPts + (2 * 90000) >= lastPts)
dieNow = 1; dieNow = 1;
} else }
else
{ {
playback_err("playback already died ?\n"); playback_err("playback already died ?\n");
dieNow = 1; dieNow = 1;