Commit aac54d84 authored by mhoffman's avatar mhoffman

using isnan instead of d==d, to signal correctly parsed option

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@10406 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 9f287311
...@@ -2567,7 +2567,7 @@ static void opt_input_file(const char *filename) ...@@ -2567,7 +2567,7 @@ static void opt_input_file(const char *filename)
for(i=0; i<opt_name_count; i++){ for(i=0; i<opt_name_count; i++){
const AVOption *opt; const AVOption *opt;
double d= av_get_double(avformat_opts, opt_names[i], &opt); double d= av_get_double(avformat_opts, opt_names[i], &opt);
if(d==d && (opt->flags&AV_OPT_FLAG_DECODING_PARAM)) if(!isnan(d) && (opt->flags&AV_OPT_FLAG_DECODING_PARAM))
av_set_double(ic, opt_names[i], d); av_set_double(ic, opt_names[i], d);
} }
/* open the input file with generic libav function */ /* open the input file with generic libav function */
...@@ -2615,7 +2615,7 @@ static void opt_input_file(const char *filename) ...@@ -2615,7 +2615,7 @@ static void opt_input_file(const char *filename)
for(j=0; j<opt_name_count; j++){ for(j=0; j<opt_name_count; j++){
const AVOption *opt; const AVOption *opt;
double d= av_get_double(avctx_opts[CODEC_TYPE_AUDIO], opt_names[j], &opt); double d= av_get_double(avctx_opts[CODEC_TYPE_AUDIO], opt_names[j], &opt);
if(d==d && (opt->flags&AV_OPT_FLAG_AUDIO_PARAM) && (opt->flags&AV_OPT_FLAG_DECODING_PARAM)) if(!isnan(d) && (opt->flags&AV_OPT_FLAG_AUDIO_PARAM) && (opt->flags&AV_OPT_FLAG_DECODING_PARAM))
av_set_double(enc, opt_names[j], d); av_set_double(enc, opt_names[j], d);
} }
//fprintf(stderr, "\nInput Audio channels: %d", enc->channels); //fprintf(stderr, "\nInput Audio channels: %d", enc->channels);
...@@ -2628,7 +2628,7 @@ static void opt_input_file(const char *filename) ...@@ -2628,7 +2628,7 @@ static void opt_input_file(const char *filename)
for(j=0; j<opt_name_count; j++){ for(j=0; j<opt_name_count; j++){
const AVOption *opt; const AVOption *opt;
double d= av_get_double(avctx_opts[CODEC_TYPE_VIDEO], opt_names[j], &opt); double d= av_get_double(avctx_opts[CODEC_TYPE_VIDEO], opt_names[j], &opt);
if(d==d && (opt->flags&AV_OPT_FLAG_VIDEO_PARAM) && (opt->flags&AV_OPT_FLAG_DECODING_PARAM)) if(!isnan(d) && (opt->flags&AV_OPT_FLAG_VIDEO_PARAM) && (opt->flags&AV_OPT_FLAG_DECODING_PARAM))
av_set_double(enc, opt_names[j], d); av_set_double(enc, opt_names[j], d);
} }
frame_height = enc->height; frame_height = enc->height;
...@@ -2774,7 +2774,7 @@ static void new_video_stream(AVFormatContext *oc) ...@@ -2774,7 +2774,7 @@ static void new_video_stream(AVFormatContext *oc)
for(i=0; i<opt_name_count; i++){ for(i=0; i<opt_name_count; i++){
const AVOption *opt; const AVOption *opt;
double d= av_get_double(avctx_opts[CODEC_TYPE_VIDEO], opt_names[i], &opt); double d= av_get_double(avctx_opts[CODEC_TYPE_VIDEO], opt_names[i], &opt);
if(d==d && (opt->flags&AV_OPT_FLAG_VIDEO_PARAM) && (opt->flags&AV_OPT_FLAG_ENCODING_PARAM)) if(!isnan(d) && (opt->flags&AV_OPT_FLAG_VIDEO_PARAM) && (opt->flags&AV_OPT_FLAG_ENCODING_PARAM))
av_set_double(video_enc, opt_names[i], d); av_set_double(video_enc, opt_names[i], d);
} }
...@@ -2917,7 +2917,7 @@ static void new_audio_stream(AVFormatContext *oc) ...@@ -2917,7 +2917,7 @@ static void new_audio_stream(AVFormatContext *oc)
for(i=0; i<opt_name_count; i++){ for(i=0; i<opt_name_count; i++){
const AVOption *opt; const AVOption *opt;
double d= av_get_double(avctx_opts[CODEC_TYPE_AUDIO], opt_names[i], &opt); double d= av_get_double(avctx_opts[CODEC_TYPE_AUDIO], opt_names[i], &opt);
if(d==d && (opt->flags&AV_OPT_FLAG_AUDIO_PARAM) && (opt->flags&AV_OPT_FLAG_ENCODING_PARAM)) if(!isnan(d) && (opt->flags&AV_OPT_FLAG_AUDIO_PARAM) && (opt->flags&AV_OPT_FLAG_ENCODING_PARAM))
av_set_double(audio_enc, opt_names[i], d); av_set_double(audio_enc, opt_names[i], d);
} }
...@@ -2967,7 +2967,7 @@ static void new_subtitle_stream(AVFormatContext *oc) ...@@ -2967,7 +2967,7 @@ static void new_subtitle_stream(AVFormatContext *oc)
for(i=0; i<opt_name_count; i++){ for(i=0; i<opt_name_count; i++){
const AVOption *opt; const AVOption *opt;
double d= av_get_double(avctx_opts[CODEC_TYPE_SUBTITLE], opt_names[i], &opt); double d= av_get_double(avctx_opts[CODEC_TYPE_SUBTITLE], opt_names[i], &opt);
if(d==d && (opt->flags&AV_OPT_FLAG_SUBTITLE_PARAM) && (opt->flags&AV_OPT_FLAG_ENCODING_PARAM)) if(!isnan(d) && (opt->flags&AV_OPT_FLAG_SUBTITLE_PARAM) && (opt->flags&AV_OPT_FLAG_ENCODING_PARAM))
av_set_double(subtitle_enc, opt_names[i], d); av_set_double(subtitle_enc, opt_names[i], d);
} }
subtitle_enc->codec_id = find_codec_or_die(subtitle_codec_name, CODEC_TYPE_SUBTITLE, 1); subtitle_enc->codec_id = find_codec_or_die(subtitle_codec_name, CODEC_TYPE_SUBTITLE, 1);
...@@ -3159,7 +3159,7 @@ static void opt_output_file(const char *filename) ...@@ -3159,7 +3159,7 @@ static void opt_output_file(const char *filename)
for(i=0; i<opt_name_count; i++){ for(i=0; i<opt_name_count; i++){
const AVOption *opt; const AVOption *opt;
double d = av_get_double(avformat_opts, opt_names[i], &opt); double d = av_get_double(avformat_opts, opt_names[i], &opt);
if(d==d && (opt->flags&AV_OPT_FLAG_ENCODING_PARAM)) if(!isnan(d) && (opt->flags&AV_OPT_FLAG_ENCODING_PARAM))
av_set_double(oc, opt_names[i], d); av_set_double(oc, opt_names[i], d);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment