Unified · Split
| @@ -128,21 +128,20 @@ static int choose_encoder(const OptionsContext *o, AVFormatContext *s, · 127 unmodified lines | ||
| 128 | 128 | return 0; |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | − if (!codec_name) { | |
| 132 | − ost->par_in->codec_id = av_guess_codec(s->oformat, NULL, s->url, | |
| 133 | − NULL, ost->type); | |
| 134 | − *enc = avcodec_find_encoder(ost->par_in->codec_id); | |
| 135 | − if (!*enc) { | |
| 136 | − av_log(ost, AV_LOG_FATAL, "Automatic encoder selection failed " | |
| 137 | − "Default encoder for format %s (codec %s) is " | |
| 138 | − "probably disabled. Please choose an encoder manually.\n", | |
| 139 | − s->oformat->name, avcodec_get_name(ost->par_in->codec_id)); | |
| 140 | − return AVERROR_ENCODER_NOT_FOUND; | |
| 141 | − } | |
| 142 | − } else if (strcmp(codec_name, "copy")) { | |
| 143 | − *enc = find_codec_or_die(ost, codec_name, ost->type, 1); | |
| 144 | − ost->par_in->codec_id = (*enc)->id; | |
| 145 | − } | |
| 131 | + if (!codec_name) { | |
| 132 | + ost->par_in->codec_id = av_guess_codec(s->oformat, NULL, s->url, NULL, ost->type); | |
| 133 | + *enc = avcodec_find_encoder(ost->par_in->codec_id); | |
| 134 | + if (!*enc) { | |
| 135 | + av_log(ost, AV_LOG_FATAL, "Automatic encoder selection failed " | |
| 136 | + "Default encoder for format %s (codec %s) is " | |
| 137 | + "probably disabled. Please choose an encoder manually.\n", | |
| 138 | + s->oformat->name, avcodec_get_name(ost->par_in->codec_id)); | |
| 139 | + return AVERROR_ENCODER_NOT_FOUND; | |
| 140 | + } | |
| 141 | + } else if (strcmp(codec_name, "copy")) { | |
| 142 | + *enc = find_codec_or_die(ost, codec_name, ost->type, 1); | |
| 143 | + ost->par_in->codec_id = (*enc)->id; | |
| 144 | + } | |
| 146 | 145 | |
| 147 | 146 | return 0; |
| 148 | 147 | } |