diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-10-26 02:09:31 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-10-26 02:36:07 +0200 |
commit | 51bfaa21c85201ab31776a447599349a1ed6e96b (patch) | |
tree | b7baafad803a06c5d582606f37f91a27e8342e59 /libavformat/mpegenc.c | |
parent | f5fdb12d5552a3710611f15cd72ce6c7b6fb4da0 (diff) | |
parent | a3a8572165ce636fb011b78764a2584777f81b95 (diff) | |
download | ffmpeg-51bfaa21c85201ab31776a447599349a1ed6e96b.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master: (22 commits)
g722dec: check output buffer size before decoding
g722dec: cosmetics: reindent/linewrap
g722dec: remove the use of lowres for half-rate decoding.
tta: check for extradata allocation failure in tta demuxer
tta: check for allocation failure of decode_buffer
tta: use correct frame_length calculation.
tta: add support for decoding 24-bit sample format
cosmetics: indentation
tta: remove pointless braces
tta: check output buffer size after adjusting frame length for last frame
tta: fix reading of format in TTA header.
tta: remove useless commented-out lines
tta: check remaining bitstream size while reading unary value
lavf: deprecate AVStream.stream_copy
avconc: split choose_codec() to choose_decoder/choose_encoder.
lavf: simplify by using FFMAX/FFMIN.
mpegenc: add preload private option.
cosmetics: simplify latm_decode_init
latm: avoid unnecessary reinit of the aac decoder
aacdec: initialize sbr context only in new channel elements
...
Conflicts:
avconv.c
libavcodec/resample.c
libavcodec/tta.c
libavformat/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegenc.c')
-rw-r--r-- | libavformat/mpegenc.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index 817f541805..9e19a3d5e4 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c @@ -77,6 +77,7 @@ typedef struct { double vcd_padding_bitrate; //FIXME floats int64_t vcd_padding_bytes_written; + int preload; } MpegMuxContext; extern AVOutputFormat ff_mpeg1vcd_muxer; @@ -1158,9 +1159,15 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt) 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; @@ -1237,6 +1244,7 @@ static int mpeg_mux_end(AVFormatContext *ctx) #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 }, }; |