summaryrefslogtreecommitdiff
path: root/avconv_opt.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-02-25 15:41:45 +0100
committerAnton Khirnov <anton@khirnov.net>2016-03-20 08:15:01 +0100
commit4426540f0c3ee516662f79d0a6ab5b95503b6611 (patch)
tree296b8f1d98f10ee42f62e2db40382860573981f4 /avconv_opt.c
parent33d18982fa03feb061c8f744a4f0a9175c1f63ab (diff)
avconv: switch to the new BSF API
Diffstat (limited to 'avconv_opt.c')
-rw-r--r--avconv_opt.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/avconv_opt.c b/avconv_opt.c
index 56c67595df..3df11da9e1 100644
--- a/avconv_opt.c
+++ b/avconv_opt.c
@@ -912,7 +912,6 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
AVStream *st = avformat_new_stream(oc, NULL);
int idx = oc->nb_streams - 1, ret = 0;
char *bsf = NULL, *next, *codec_tag = NULL;
- AVBitStreamFilterContext *bsfc, *bsfc_prev = NULL;
double qscale = -1;
if (!st) {
@@ -980,19 +979,26 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
MATCH_PER_STREAM_OPT(bitstream_filters, str, bsf, oc, st);
while (bsf) {
+ const AVBitStreamFilter *filter;
+
if (next = strchr(bsf, ','))
*next++ = 0;
- if (!(bsfc = av_bitstream_filter_init(bsf))) {
+
+ filter = av_bsf_get_by_name(bsf);
+ if (!bsf) {
av_log(NULL, AV_LOG_FATAL, "Unknown bitstream filter %s\n", bsf);
exit_program(1);
}
- if (bsfc_prev)
- bsfc_prev->next = bsfc;
- else
- ost->bitstream_filters = bsfc;
- bsfc_prev = bsfc;
- bsf = next;
+ ost->bitstream_filters = av_realloc_array(ost->bitstream_filters,
+ ost->nb_bitstream_filters + 1,
+ sizeof(*ost->bitstream_filters));
+ if (!ost->bitstream_filters)
+ exit_program(1);
+
+ ost->bitstream_filters[ost->nb_bitstream_filters++] = filter;
+
+ bsf = next;
}
MATCH_PER_STREAM_OPT(codec_tags, str, codec_tag, oc, st);