}
while (!f->exit) {
- sleep(2);
-
- int vn = 0;
- int an = 0;
+ int vn = 0;
+ int an = 0;
for (l = scf_list_head(&f->inputs); l != scf_list_sentinel(&f->inputs); l != scf_list_next(l)) {
io = scf_list_data(l, simp_avio_t, list);
for (l = scf_list_head(&f->outputs); l != scf_list_sentinel(&f->outputs); l != scf_list_next(l)) {
io = scf_list_data(l, simp_avio_t, list);
- vf = simp_frame_alloc();
+ vf = calloc(1, sizeof(simp_frame_t));
if (!vf) {
f->error = -ENOMEM;
goto error;
}
- if (av_frame_copy(vf->frame, f->vframe) < 0) {
+ vf->frame = av_frame_clone(f->vframe);
+ if (!vf->frame) {
simp_frame_free(vf);
vf = NULL;
goto error;
}
- scf_loge("\n");
pthread_mutex_lock(&io->mutex);
scf_list_add_tail(&io->vout, &vf->list);
pthread_cond_signal(&io->cond);
pthread_mutex_unlock(&io->mutex);
vf = NULL;
}
+
+ av_frame_unref(f->vframe);
}
- scf_loge("\n");
while (1) {
int ret = av_buffersink_get_frame(f->abuffersink_ctx, f->aframe);
goto error;
}
- scf_loge("\n");
for (l = scf_list_head(&f->outputs); l != scf_list_sentinel(&f->outputs); l != scf_list_next(l)) {
io = scf_list_data(l, simp_avio_t, list);
goto error;
}
- scf_loge("\n");
pthread_mutex_lock(&io->mutex);
scf_list_add_tail(&io->aout, &af->list);
pthread_cond_signal(&io->cond);
pthread_mutex_unlock(&io->mutex);
af = NULL;
}
+
+ av_frame_unref(f->aframe);
}
}