libeplayer3: fix segv

This commit is contained in:
martii
2013-04-10 20:41:44 +02:00
committed by Stefan Seyfried
parent 2368ec790f
commit 9edd4277c3

View File

@@ -1491,6 +1491,7 @@ static void ffmpeg_buf_free()
/* Container part for ffmpeg */
/* **************************** */
#ifdef MARTII
static int terminating = 0;
static int interrupt_cb(void *ctx)
{
PlaybackHandler_t *p = (PlaybackHandler_t *)ctx;
@@ -1642,11 +1643,17 @@ int container_ffmpeg_init(Context_t *context, char * filename)
//for buffered io (end)
#endif
#ifdef MARTII
terminating = 0;
latestPts = 0;
isContainerRunning = 1;
return container_ffmpeg_update_tracks(context, filename);
}
int container_ffmpeg_update_tracks(Context_t *context, char *filename)
{
if (terminating)
return cERR_CONTAINER_FFMPEG_NO_ERROR;
int n;
if (context->manager->audio)
@@ -2070,9 +2077,11 @@ int container_ffmpeg_update_tracks(Context_t *context, char *filename)
} /* for */
#ifndef MARTII
/* init */
latestPts = 0;
isContainerRunning = 1;
#endif
releaseMutex(FILENAME, __FUNCTION__,__LINE__);
@@ -2172,6 +2181,9 @@ static int container_ffmpeg_stop(Context_t *context) {
}
hasPlayThreadStarted = 0;
#ifdef MARTII
terminating = 1;
#endif
getMutex(FILENAME, __FUNCTION__,__LINE__);