I have a code like the following, which works fine:
AVFrame *frame = NULL;
open_input(&frame);
where the input argument of open_input is something like: AVFrame **frame;
Now, I want to extend this code to work with an array of frames (say, N frames). I tried the following code but my code stops working after being compiled by gcc in MingW:
int i, N = 3;
AVFrame **frame;
frame = (AVFrame *) malloc(N * sizeof(AVFrame *));
for(i=0;i<N;i++){
frame[i] = (AVFrame *) malloc(sizeof(AVFrame));
open_input(&frame[i]);
}
Do you know, what is the problem?