diff options
author | Paul B Mahol <onemda@gmail.com> | 2013-10-05 20:19:23 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2015-08-26 11:12:23 +0000 |
commit | 0190c372ef79740ddc546e9ce1877a908475d3e1 (patch) | |
tree | e4cc964790855da1cc85dd0d540d1e7004b6284b /libavfilter/framesync.c | |
parent | a16251a6d0401c772bd985f4c611caf97ca5e537 (diff) | |
download | ffmpeg-0190c372ef79740ddc546e9ce1877a908475d3e1.tar.gz |
avfilter/framesync: allocate FFFrameSyncIn internally
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/framesync.c')
-rw-r--r-- | libavfilter/framesync.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libavfilter/framesync.c b/libavfilter/framesync.c index 12db50cb77..bdac40b783 100644 --- a/libavfilter/framesync.c +++ b/libavfilter/framesync.c @@ -46,11 +46,16 @@ enum { STATE_EOF, }; -void ff_framesync_init(FFFrameSync *fs, void *parent, unsigned nb_in) +int ff_framesync_init(FFFrameSync *fs, void *parent, unsigned nb_in) { fs->class = &framesync_class; fs->parent = parent; fs->nb_in = nb_in; + + fs->in = av_calloc(nb_in, sizeof(*fs->in)); + if (!fs->in) + return AVERROR(ENOMEM); + return 0; } static void framesync_sync_level_update(FFFrameSync *fs) @@ -267,6 +272,8 @@ void ff_framesync_uninit(FFFrameSync *fs) av_frame_free(&fs->in[i].frame_next); ff_bufqueue_discard_all(&fs->in[i].queue); } + + av_freep(&fs->in); } int ff_framesync_process_frame(FFFrameSync *fs, unsigned all) |