History

avfilter/framesync: allocate FFFrameSyncIn internally

Paul B Mahol committed 13 years ago

Commit 0190c371 parent a16251a5 files · +22 −10Browse files

Showing the changes to libavfilter/framesync.c (1 of 5 files). Show all

Unified · Split

libavfilter/framesync.c+8−1
@@ -46,11 +46,16 @@ enum { · 45 unmodified lines
4646 STATE_EOF,
4747 };
4848
49−void ff_framesync_init(FFFrameSync *fs, void *parent, unsigned nb_in)
49+int ff_framesync_init(FFFrameSync *fs, void *parent, unsigned nb_in)
5050 {
5151 fs->class = &framesync_class;
5252 fs->parent = parent;
5353 fs->nb_in = nb_in;
54+
55+ fs->in = av_calloc(nb_in, sizeof(*fs->in));
56+ if (!fs->in)
57+ return AVERROR(ENOMEM);
58+ return 0;
5459 }
5560
5661 static void framesync_sync_level_update(FFFrameSync *fs)
@@ -267,6 +272,8 @@ void ff_framesync_uninit(FFFrameSync *fs) · 210 unmodified lines
267272 av_frame_free(&fs->in[i].frame_next);
268273 ff_bufqueue_discard_all(&fs->in[i].queue);
269274 }
275+
276+ av_freep(&fs->in);
270277 }
271278
272279 int ff_framesync_process_frame(FFFrameSync *fs, unsigned all)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t