aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg_opt.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-10-08 11:38:47 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2016-10-08 11:38:47 +0200
commit3e5e5bdfef07526aa5c6b15e0484bdc51289cad9 (patch)
treef5c3754aa42bf8ca8d541fb771ca7644c89da3ad /ffmpeg_opt.c
parentc45ba265fcbb57fcacf82f66cb2a2643210308e1 (diff)
parent398f015f077c6a2406deffd9e37ff34b9c7bb3bc (diff)
downloadffmpeg-3e5e5bdfef07526aa5c6b15e0484bdc51289cad9.tar.gz
Merge commit '398f015f077c6a2406deffd9e37ff34b9c7bb3bc'
* commit '398f015f077c6a2406deffd9e37ff34b9c7bb3bc': avconv: buffer the packets written while the muxer is not initialized Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'ffmpeg_opt.c')
-rw-r--r--ffmpeg_opt.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index bea2829e4a..4d25fff410 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -1395,6 +1395,10 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
MATCH_PER_STREAM_OPT(disposition, str, ost->disposition, oc, st);
ost->disposition = av_strdup(ost->disposition);
+ ost->max_muxing_queue_size = 128;
+ MATCH_PER_STREAM_OPT(max_muxing_queue_size, i, ost->max_muxing_queue_size, oc, st);
+ ost->max_muxing_queue_size *= sizeof(AVPacket);
+
if (oc->oformat->flags & AVFMT_GLOBALHEADER)
ost->enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
@@ -1414,6 +1418,10 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
}
ost->last_mux_dts = AV_NOPTS_VALUE;
+ ost->muxing_queue = av_fifo_alloc(8 * sizeof(AVPacket));
+ if (!ost->muxing_queue)
+ exit_program(1);
+
return ost;
}
@@ -3565,6 +3573,10 @@ const OptionDef options[] = {
"set the subtitle options to the indicated preset", "preset" },
{ "fpre", HAS_ARG | OPT_EXPERT| OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_preset },
"set options from indicated preset file", "filename" },
+
+ { "max_muxing_queue_size", HAS_ARG | OPT_INT | OPT_SPEC | OPT_EXPERT | OPT_OUTPUT, { .off = OFFSET(max_muxing_queue_size) },
+ "maximum number of packets that can be buffered while waiting for all streams to initialize", "packets" },
+
/* data codec support */
{ "dcodec", HAS_ARG | OPT_DATA | OPT_PERFILE | OPT_EXPERT | OPT_INPUT | OPT_OUTPUT, { .func_arg = opt_data_codec },
"force data codec ('copy' to copy stream)", "codec" },