avformat/mpegenc: check, warn and clip VBV value to within syntactically possible values

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-09-29 17:02:06 +02:00
parent 28d35dbe9f
commit 8c1253c934
1 changed files with 4 additions and 0 deletions

View File

@ -379,6 +379,10 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
av_log(ctx, AV_LOG_WARNING, "VBV buffer size not set, muxing may fail\n");
stream->max_buffer_size = 230*1024; //FIXME this is probably too small as default
}
if (stream->max_buffer_size > 1024 * 8191) {
av_log(ctx, AV_LOG_WARNING, "buffer size %d, too large\n", stream->max_buffer_size);
stream->max_buffer_size = 1024 * 8191;
}
s->video_bound++;
break;
case AVMEDIA_TYPE_SUBTITLE: