Revert "workaround for double malloc if container_ffmpeg_stop is not called after file play to end"

This reverts commit 2d9b643ac6.


Origin commit data
------------------
Branch: master
Commit: 9736caf6d9
Author: max_10 <max_10@gmx.de>
Date: 2019-02-26 (Tue, 26 Feb 2019)



------------------
This commit was generated by Migit
This commit is contained in:
max_10
2019-02-26 21:10:32 +01:00
parent d7295b8630
commit 83d9b453fc

View File

@@ -1533,9 +1533,7 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, uin
0 == strncmp(filename, "file://", 7))
{
AVIOContext *avio_ctx = NULL;
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));
custom_io_tab[AVIdx] = malloc(sizeof(CustomIOCtx_t));
memset(custom_io_tab[AVIdx], 0x00, sizeof(CustomIOCtx_t));
custom_io_tab[AVIdx]->szFile = filename;
@@ -2733,11 +2731,7 @@ static int32_t container_ffmpeg_stop(Context_t *context)
fclose(io->pFile);
if (io->pMoovFile)
fclose(io->pMoovFile);
if(custom_io_tab[i] != NULL)
{
free(custom_io_tab[i]);
custom_io_tab[i] = NULL;
}
free(custom_io_tab[i]);
av_freep(&(avContextTab[i]->pb->buffer));
av_freep(&(avContextTab[i]->pb));
use_custom_io[i] = 0;