ffmpeg_opt: Use av_guess_codec() instead of AVOutputFormat->*codec
Fixes part of ticket2236
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 956f4087c6
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -1690,7 +1690,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
|
|||||||
/* pick the "best" stream of each type */
|
/* pick the "best" stream of each type */
|
||||||
|
|
||||||
/* video: highest resolution */
|
/* video: highest resolution */
|
||||||
if (!o->video_disable && oc->oformat->video_codec != AV_CODEC_ID_NONE) {
|
if (!o->video_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_VIDEO) != AV_CODEC_ID_NONE) {
|
||||||
int area = 0, idx = -1;
|
int area = 0, idx = -1;
|
||||||
int qcr = avformat_query_codec(oc->oformat, oc->oformat->video_codec, 0);
|
int qcr = avformat_query_codec(oc->oformat, oc->oformat->video_codec, 0);
|
||||||
for (i = 0; i < nb_input_streams; i++) {
|
for (i = 0; i < nb_input_streams; i++) {
|
||||||
@@ -1712,7 +1712,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* audio: most channels */
|
/* audio: most channels */
|
||||||
if (!o->audio_disable && oc->oformat->audio_codec != AV_CODEC_ID_NONE) {
|
if (!o->audio_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_AUDIO) != AV_CODEC_ID_NONE) {
|
||||||
int channels = 0, idx = -1;
|
int channels = 0, idx = -1;
|
||||||
for (i = 0; i < nb_input_streams; i++) {
|
for (i = 0; i < nb_input_streams; i++) {
|
||||||
ist = input_streams[i];
|
ist = input_streams[i];
|
||||||
|
Reference in New Issue
Block a user