diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-04-07 22:13:58 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-04-07 22:13:58 +0200 |
commit | 4bcb75cc48be18341919f86ce26fa1f4db624f67 (patch) | |
tree | 099b06e0e40ce2419e60ae80f2432977f6511458 /ffmpeg_opt.c | |
parent | 2f284c017000065539b5ab7183a3f8140c69dfb2 (diff) | |
download | ffmpeg-4bcb75cc48be18341919f86ce26fa1f4db624f67.tar.gz |
ffmpeg: Print a warning when -frames is affecting non video frames
Fixes Ticket2395
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg_opt.c')
-rw-r--r-- | ffmpeg_opt.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index 63a238ddfa..1f4d89ef89 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -972,6 +972,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e char *bsf = NULL, *next, *codec_tag = NULL; AVBitStreamFilterContext *bsfc, *bsfc_prev = NULL; double qscale = -1; + int i; if (!st) { av_log(NULL, AV_LOG_FATAL, "Could not alloc stream.\n"); @@ -1030,6 +1031,13 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e ost->max_frames = INT64_MAX; MATCH_PER_STREAM_OPT(max_frames, i64, ost->max_frames, oc, st); + for (i = 0; i<o->nb_max_frames; i++) { + char *p = o->max_frames[i].specifier; + if (!*p && type != AVMEDIA_TYPE_VIDEO) { + av_log(NULL, AV_LOG_WARNING, "Applying unspecific -frames to non video streams, maybe you meant -vframes ?\n"); + break; + } + } ost->copy_prior_start = -1; MATCH_PER_STREAM_OPT(copy_prior_start, i, ost->copy_prior_start, oc ,st); |