| 2985 | } |
| 2986 | |
| 2987 | static int init_output_bsfs(OutputStream *ost) |
| 2988 | { |
| 2989 | AVBSFContext *ctx; |
| 2990 | int i, ret; |
| 2991 | |
| 2992 | if (!ost->nb_bitstream_filters) |
| 2993 | return 0; |
| 2994 | |
| 2995 | for (i = 0; i < ost->nb_bitstream_filters; i++) { |
| 2996 | ctx = ost->bsf_ctx[i]; |
| 2997 | |
| 2998 | ret = avcodec_parameters_copy(ctx->par_in, |
| 2999 | i ? ost->bsf_ctx[i - 1]->par_out : ost->st->codecpar); |
| 3000 | if (ret < 0) |
| 3001 | return ret; |
| 3002 | |
| 3003 | ctx->time_base_in = i ? ost->bsf_ctx[i - 1]->time_base_out : ost->st->time_base; |
| 3004 | |
| 3005 | ret = av_bsf_init(ctx); |
| 3006 | if (ret < 0) { |
| 3007 | av_log(NULL, AV_LOG_ERROR, "Error initializing bitstream filter: %s\n", |
| 3008 | ost->bsf_ctx[i]->filter->name); |
| 3009 | return ret; |
| 3010 | } |
| 3011 | } |
| 3012 | |
| 3013 | ctx = ost->bsf_ctx[ost->nb_bitstream_filters - 1]; |
| 3014 | ret = avcodec_parameters_copy(ost->st->codecpar, ctx->par_out); |
| 3015 | if (ret < 0) |
| 3016 | return ret; |
| 3017 | |
| 3018 | ost->st->time_base = ctx->time_base_out; |
| 3019 | |
| 3020 | return 0; |
| 3021 | } |
| 3022 | |
| 3023 | static int init_output_stream_streamcopy(OutputStream *ost) |
| 3024 | { |
no outgoing calls
no test coverage detected