From d7295b8630994d72424c87e6a491181bf3774a53 Mon Sep 17 00:00:00 2001 From: max_10 Date: Tue, 26 Feb 2019 21:10:10 +0100 Subject: [PATCH] Revert "try fix to call container_ffmpeg_stop on file EOF" This reverts commit 3acfc0ce33e8cfa0af2e7d8dda3c7f64bac962dc. Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/3d213ed65f2efa103e838c19266a0e2fbbff0d9d Author: max_10 Date: 2019-02-26 (Tue, 26 Feb 2019) ------------------ This commit was generated by Migit --- libeplayer3-arm/container/container_ffmpeg.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/libeplayer3-arm/container/container_ffmpeg.c b/libeplayer3-arm/container/container_ffmpeg.c index 4692b4e..074155c 100644 --- a/libeplayer3-arm/container/container_ffmpeg.c +++ b/libeplayer3-arm/container/container_ffmpeg.c @@ -126,7 +126,6 @@ static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t ab static int32_t container_ffmpeg_get_length(Context_t *context, int64_t *length); static int64_t calcPts(uint32_t avContextIdx, AVStream *stream, int64_t pts); static int64_t doCalcPts(int64_t start_time, const AVRational time_base, int64_t pts); -static int32_t container_ffmpeg_stop(Context_t *context); /* Progressive playback means that we play local file * but this local file can grows up, for example @@ -1353,11 +1352,6 @@ static void FFMPEGThread(Context_t *context) do_seek_target_seconds = 0; PlaybackDieNow(1); - if(context && context->playback) - { - container_ffmpeg_stop(context); - } - ffmpeg_printf(10, "terminating\n"); } @@ -1539,7 +1533,8 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, uin 0 == strncmp(filename, "file://", 7)) { AVIOContext *avio_ctx = NULL; - custom_io_tab[AVIdx] = malloc(sizeof(CustomIOCtx_t)); + if(custom_io_tab[AVIdx] == NULL)//workaround for double malloc if container_ffmpeg_stop is not called after file play to end + custom_io_tab[AVIdx] = malloc(sizeof(CustomIOCtx_t)); memset(custom_io_tab[AVIdx], 0x00, sizeof(CustomIOCtx_t));