aboutsummaryrefslogtreecommitdiffstats
path: root/avconv.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2016-10-28 21:44:51 -0300
committerAnton Khirnov <anton@khirnov.net>2016-11-02 10:08:28 +0100
commit064f19f39e2f17927278c6ad8fe884a5b92310d6 (patch)
treeb7a0c56fd0cf781f7ea9240f730d18a82ab35d09 /avconv.c
parentecd2ec69ce10e13f6ede353d2def7ce9f45c1a7d (diff)
downloadffmpeg-064f19f39e2f17927278c6ad8fe884a5b92310d6.tar.gz
avconv: support parsing bitstream filter options
Example usage: avconv -i INPUT -bsf filter[=opt1=val1:opt2=val2] OUTPUT Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/avconv.c b/avconv.c
index 0b75cbe214..4bd28e6e3b 100644
--- a/avconv.c
+++ b/avconv.c
@@ -190,7 +190,6 @@ static void avconv_cleanup(int ret)
for (j = 0; j < ost->nb_bitstream_filters; j++)
av_bsf_free(&ost->bsf_ctx[j]);
av_freep(&ost->bsf_ctx);
- av_freep(&ost->bitstream_filters);
av_frame_free(&ost->filtered_frame);
@@ -1798,17 +1797,8 @@ static int init_output_bsfs(OutputStream *ost)
if (!ost->nb_bitstream_filters)
return 0;
- ost->bsf_ctx = av_mallocz_array(ost->nb_bitstream_filters, sizeof(*ost->bsf_ctx));
- if (!ost->bsf_ctx)
- return AVERROR(ENOMEM);
-
for (i = 0; i < ost->nb_bitstream_filters; i++) {
- ret = av_bsf_alloc(ost->bitstream_filters[i], &ctx);
- if (ret < 0) {
- av_log(NULL, AV_LOG_ERROR, "Error allocating a bitstream filter context\n");
- return ret;
- }
- ost->bsf_ctx[i] = ctx;
+ ctx = ost->bsf_ctx[i];
ret = avcodec_parameters_copy(ctx->par_in,
i ? ost->bsf_ctx[i - 1]->par_out : ost->st->codecpar);
@@ -1820,12 +1810,11 @@ static int init_output_bsfs(OutputStream *ost)
ret = av_bsf_init(ctx);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Error initializing bitstream filter: %s\n",
- ost->bitstream_filters[i]->name);
+ ctx->filter->name);
return ret;
}
}
- ctx = ost->bsf_ctx[ost->nb_bitstream_filters - 1];
ret = avcodec_parameters_copy(ost->st->codecpar, ctx->par_out);
if (ret < 0)
return ret;