#include "libavutil/pixfmt.h"
#include "libavutil/samplefmt.h"
-/**
- * Define a function for building a string containing a list of
- * allowed formats,
- */
+/* Define a function for building a string containing a list of
+ * allowed formats. */
#define DEF_CHOOSE_FORMAT(type, var, supported_list, none, get_name, separator)\
static char *choose_ ## var ## s(OutputStream *ost) \
{ \
int len; \
\
if (avio_open_dyn_buf(&s) < 0) \
- exit_program(1); \
+ exit(1); \
\
for (p = ost->enc->supported_list; *p != none; p++) { \
get_name(*p); \
return NULL; \
}
-DEF_CHOOSE_FORMAT(enum PixelFormat, pix_fmt, pix_fmts, PIX_FMT_NONE,
+DEF_CHOOSE_FORMAT(enum AVPixelFormat, pix_fmt, pix_fmts, AV_PIX_FMT_NONE,
GET_PIX_FMT_NAME, ":")
DEF_CHOOSE_FORMAT(enum AVSampleFormat, sample_fmt, sample_fmts,
FilterGraph *fg = av_mallocz(sizeof(*fg));
if (!fg)
- exit_program(1);
+ exit(1);
fg->index = nb_filtergraphs;
fg->outputs = grow_array(fg->outputs, sizeof(*fg->outputs), &fg->nb_outputs,
fg->nb_outputs + 1);
if (!(fg->outputs[0] = av_mallocz(sizeof(*fg->outputs[0]))))
- exit_program(1);
+ exit(1);
fg->outputs[0]->ost = ost;
fg->outputs[0]->graph = fg;
fg->inputs = grow_array(fg->inputs, sizeof(*fg->inputs), &fg->nb_inputs,
fg->nb_inputs + 1);
if (!(fg->inputs[0] = av_mallocz(sizeof(*fg->inputs[0]))))
- exit_program(1);
+ exit(1);
fg->inputs[0]->ist = ist;
fg->inputs[0]->graph = fg;
if (type != AVMEDIA_TYPE_VIDEO && type != AVMEDIA_TYPE_AUDIO) {
av_log(NULL, AV_LOG_FATAL, "Only video and audio filters supported "
"currently.\n");
- exit_program(1);
+ exit(1);
}
if (in->name) {
if (file_idx < 0 || file_idx >= nb_input_files) {
av_log(NULL, AV_LOG_FATAL, "Invalid file index %d in filtegraph description %s.\n",
file_idx, fg->graph_desc);
- exit_program(1);
+ exit(1);
}
s = input_files[file_idx]->ctx;
if (!st) {
av_log(NULL, AV_LOG_FATAL, "Stream specifier '%s' in filtergraph description %s "
"matches no streams.\n", p, fg->graph_desc);
- exit_program(1);
+ exit(1);
}
ist = input_streams[input_files[file_idx]->ist_index + st->index];
} else {
av_log(NULL, AV_LOG_FATAL, "Cannot find a matching stream for "
"unlabeled input pad %d on filter %s", in->pad_idx,
in->filter_ctx->name);
- exit_program(1);
+ exit(1);
}
}
av_assert0(ist);
fg->inputs = grow_array(fg->inputs, sizeof(*fg->inputs),
&fg->nb_inputs, fg->nb_inputs + 1);
if (!(fg->inputs[fg->nb_inputs - 1] = av_mallocz(sizeof(*fg->inputs[0]))))
- exit_program(1);
+ exit(1);
fg->inputs[fg->nb_inputs - 1]->ist = ist;
fg->inputs[fg->nb_inputs - 1]->graph = fg;
snprintf(name, sizeof(name), "output stream %d:%d", ost->file_index, ost->index);
ret = avfilter_graph_create_filter(&ofilter->filter,
avfilter_get_by_name("buffersink"),
- name, NULL, pix_fmts, fg->graph);
+ name, NULL, NULL, fg->graph);
if (ret < 0)
return ret;
AVIOContext *pb; \
\
if (avio_open_dyn_buf(&pb) < 0) \
- exit_program(1); \
+ exit(1); \
\
avio_printf(pb, "%s", ctx->filter->name); \
if (nb_pads > 1) \
fg->outputs = grow_array(fg->outputs, sizeof(*fg->outputs),
&fg->nb_outputs, fg->nb_outputs + 1);
if (!(fg->outputs[fg->nb_outputs - 1] = av_mallocz(sizeof(*fg->outputs[0]))))
- exit_program(1);
+ exit(1);
fg->outputs[fg->nb_outputs - 1]->graph = fg;
fg->outputs[fg->nb_outputs - 1]->out_tmp = cur;
cur = cur->next;