memset(o, 0, sizeof(*o));
- o->mux_preload = 0.5;
o->mux_max_delay = 0.7;
o->recording_time = INT64_MAX;
o->limit_filesize = UINT64_MAX;
}
}
- oc->preload = (int)(o->mux_preload * AV_TIME_BASE);
+ if (o->mux_preload) {
+ uint8_t buf[64];
+ snprintf(buf, sizeof(buf), "%d", (int)(o->mux_preload*AV_TIME_BASE));
+ av_dict_set(&output_files[nb_output_files - 1].opts, "preload", buf, 0);
+ }
oc->max_delay = (int)(o->mux_max_delay * AV_TIME_BASE);
oc->flags |= AVFMT_FLAG_NONBLOCK;
double vcd_padding_bitrate; //FIXME floats
int64_t vcd_padding_bytes_written;
+ int preload;
} MpegMuxContext;
extern AVOutputFormat ff_mpeg1vcd_muxer;
StreamInfo *stream = st->priv_data;
int64_t pts, dts;
PacketDesc *pkt_desc;
- const int preload= av_rescale(ctx->preload, 90000, AV_TIME_BASE);
+ int preload;
const int is_iframe = st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (pkt->flags & AV_PKT_FLAG_KEY);
+#if FF_API_PRELOAD
+ if (ctx->preload)
+ s->preload = ctx->preload;
+#endif
+ preload = av_rescale(s->preload, 90000, AV_TIME_BASE);
+
pts= pkt->pts;
dts= pkt->dts;
#define E AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
{ "muxrate", NULL, OFFSET(mux_rate), AV_OPT_TYPE_INT, {0}, 0, INT_MAX, E },
+ { "preload", "Initial demux-decode delay in microseconds.", OFFSET(preload), AV_OPT_TYPE_INT, {500000}, 0, INT_MAX, E},
{ NULL },
};
#ifndef FF_API_NEW_STREAM
#define FF_API_NEW_STREAM (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
+#ifndef FF_API_PRELOAD
+#define FF_API_PRELOAD (LIBAVFORMAT_VERSION_MAJOR < 54)
+#endif
#endif /* AVFORMAT_VERSION_H */