| 3396 | } |
| 3397 | |
| 3398 | static void new_subtitle_stream(AVFormatContext *oc) |
| 3399 | { |
| 3400 | AVStream *st; |
| 3401 | AVCodecContext *subtitle_enc; |
| 3402 | |
| 3403 | st = av_new_stream(oc, oc->nb_streams); |
| 3404 | if (!st) { |
| 3405 | fprintf(stderr, "Could not alloc stream\n"); |
| 3406 | av_exit(1); |
| 3407 | } |
| 3408 | avcodec_get_context_defaults2(st->codec, AVMEDIA_TYPE_SUBTITLE); |
| 3409 | |
| 3410 | bitstream_filters[nb_output_files][oc->nb_streams - 1]= subtitle_bitstream_filters; |
| 3411 | subtitle_bitstream_filters= NULL; |
| 3412 | |
| 3413 | subtitle_enc = st->codec; |
| 3414 | subtitle_enc->codec_type = AVMEDIA_TYPE_SUBTITLE; |
| 3415 | |
| 3416 | if(subtitle_codec_tag) |
| 3417 | subtitle_enc->codec_tag= subtitle_codec_tag; |
| 3418 | |
| 3419 | if (subtitle_stream_copy) { |
| 3420 | st->stream_copy = 1; |
| 3421 | } else { |
| 3422 | set_context_opts(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], subtitle_enc, AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_ENCODING_PARAM); |
| 3423 | subtitle_enc->codec_id = find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 1, |
| 3424 | subtitle_enc->strict_std_compliance); |
| 3425 | output_codecs[nb_ocodecs] = avcodec_find_encoder_by_name(subtitle_codec_name); |
| 3426 | } |
| 3427 | nb_ocodecs++; |
| 3428 | |
| 3429 | if (subtitle_language) { |
| 3430 | av_metadata_set2(&st->metadata, "language", subtitle_language, 0); |
| 3431 | av_freep(&subtitle_language); |
| 3432 | } |
| 3433 | |
| 3434 | subtitle_disable = 0; |
| 3435 | av_freep(&subtitle_codec_name); |
| 3436 | subtitle_stream_copy = 0; |
| 3437 | } |
| 3438 | |
| 3439 | static void opt_new_audio_stream(void) |
| 3440 | { |
no test coverage detected