diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-12 01:25:37 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-12-12 01:25:37 +0100 |
commit | 7fad19a63dc52db4bf2bebbd9d261675956b1b34 (patch) | |
tree | 8997428f45d54f3177dc6cd208d0375daa6fe201 /libavformat/movenchint.c | |
parent | 16abd687798bbf9192ba4954765e61de96065b8b (diff) | |
parent | 599b4c6efddaed33b1667c386b34b07729ba732b (diff) | |
download | ffmpeg-7fad19a63dc52db4bf2bebbd9d261675956b1b34.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
x86: cabac: replace explicit memory references with "m" operands
avplay: don't request a stereo downmix
wmapro: use av_float2int()
lavc: avoid invalid memcpy() in avcodec_default_release_buffer()
lavu: replace int/float punning functions
lavfi: install libavfilter/vsrc_buffer.h
Remove extraneous semicolons
sdp: Restore the original mp4 format h264 extradata if converted
rtpenc: Add support for mp4 format h264
rtpenc: Simplify code by introducing a separate end pointer
movenc: Use the actual converted sample for RTP hinting
Fix a bunch of common typos.
Conflicts:
doc/developer.texi
doc/eval.texi
doc/filters.texi
doc/protocols.texi
ffmpeg.c
ffplay.c
libavcodec/mpegvideo.h
libavcodec/x86/cabac.h
libavfilter/Makefile
libavformat/avformat.h
libavformat/cafdec.c
libavformat/flvdec.c
libavformat/flvenc.c
libavformat/gxfenc.c
libavformat/img2.c
libavformat/movenc.c
libavformat/mpegts.c
libavformat/rtpenc_h264.c
libavformat/utils.c
libavformat/wtv.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/movenchint.c')
-rw-r--r-- | libavformat/movenchint.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/libavformat/movenchint.c b/libavformat/movenchint.c index 8e96355abc..bb55f73053 100644 --- a/libavformat/movenchint.c +++ b/libavformat/movenchint.c @@ -95,11 +95,12 @@ static void sample_queue_free(HintSampleQueue *queue) * not copied. sample_queue_retain should be called before pkt->data * is reused/freed. */ -static void sample_queue_push(HintSampleQueue *queue, AVPacket *pkt, int sample) +static void sample_queue_push(HintSampleQueue *queue, uint8_t *data, int size, + int sample) { /* No need to keep track of smaller samples, since describing them * with immediates is more efficient. */ - if (pkt->size <= 14) + if (size <= 14) return; if (!queue->samples || queue->len >= queue->size) { HintSample* samples; @@ -109,8 +110,8 @@ static void sample_queue_push(HintSampleQueue *queue, AVPacket *pkt, int sample) return; queue->samples = samples; } - queue->samples[queue->len].data = pkt->data; - queue->samples[queue->len].size = pkt->size; + queue->samples[queue->len].data = data; + queue->samples[queue->len].size = size; queue->samples[queue->len].sample_number = sample; queue->samples[queue->len].offset = 0; queue->samples[queue->len].own_data = 0; @@ -386,7 +387,8 @@ static int write_hint_packets(AVIOContext *out, const uint8_t *data, } int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt, - int track_index, int sample) + int track_index, int sample, + uint8_t *sample_data, int sample_size) { MOVMuxContext *mov = s->priv_data; MOVTrack *trk = &mov->tracks[track_index]; @@ -402,7 +404,10 @@ int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt, if (!rtp_ctx->pb) return AVERROR(ENOMEM); - sample_queue_push(&trk->sample_queue, pkt, sample); + if (sample_data) + sample_queue_push(&trk->sample_queue, sample_data, sample_size, sample); + else + sample_queue_push(&trk->sample_queue, pkt->data, pkt->size, sample); /* Feed the packet to the RTP muxer */ ff_write_chained(rtp_ctx, 0, pkt, s); |