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