Revision 118ccae0 ffmpeg.c

View differences:

ffmpeg.c
3569 3569
    AVOutputStream *ost;
3570 3570
    AVCodec *codec=NULL;
3571 3571
    AVCodecContext *subtitle_enc;
3572
    enum CodecID codec_id;
3572 3573

  
3573 3574
    st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
3574 3575
    if (!st) {
......
3579 3580
    subtitle_enc = st->codec;
3580 3581
    output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);
3581 3582
    if(!subtitle_stream_copy){
3582
        subtitle_enc->codec_id = find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 1,
3583
        if (subtitle_codec_name) {
3584
            codec_id = find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 1,
3583 3585
                                                   avcodec_opts[AVMEDIA_TYPE_SUBTITLE]->strict_std_compliance);
3584 3586
        codec= output_codecs[nb_output_codecs-1] = avcodec_find_encoder_by_name(subtitle_codec_name);
3587
        } else {
3588
            codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_SUBTITLE);
3589
            codec = avcodec_find_encoder(codec_id);
3590
        }
3585 3591
    }
3586 3592
    avcodec_get_context_defaults3(st->codec, codec);
3587 3593

  
......
3600 3606
    if (subtitle_stream_copy) {
3601 3607
        st->stream_copy = 1;
3602 3608
    } else {
3609
        subtitle_enc->codec_id = codec_id;
3603 3610
        set_context_opts(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], subtitle_enc, AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_ENCODING_PARAM, codec);
3604 3611
    }
3605 3612

  

Also available in: Unified diff