summaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2012-07-26 16:35:12 -0700
committerAnton Khirnov <anton@khirnov.net>2012-07-29 07:58:00 +0200
commit681ed0009905a088aae2a5caf2308d89aaa80562 (patch)
treee782d35012e726cd30a9cf09902ec92c1e477cfb /libavformat/utils.c
parentd905c6440637fafca56c4cd17cbe041f2aaae9ff (diff)
downloadffmpeg-streaming-681ed0009905a088aae2a5caf2308d89aaa80562.zip
ffmpeg-streaming-681ed0009905a088aae2a5caf2308d89aaa80562.tar.gz
avf: introduce nobuffer option
Useful in cases where a significant analyzeduration is still needed, while minimizing buffering before output. An example is processing low-latency streams where all media types won't necessarily come in if the analyzeduration is small. Additional changes by Josh Allmann <joshua.allmann@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 4ec70b7..149913c 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2383,9 +2383,14 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
break;
}
- pkt= add_to_pktbuf(&ic->packet_buffer, &pkt1, &ic->packet_buffer_end);
- if ((ret = av_dup_packet(pkt)) < 0)
- goto find_stream_info_err;
+ if (ic->flags & AVFMT_FLAG_NOBUFFER) {
+ pkt = &pkt1;
+ } else {
+ pkt = add_to_pktbuf(&ic->packet_buffer, &pkt1,
+ &ic->packet_buffer_end);
+ if ((ret = av_dup_packet(pkt)) < 0)
+ goto find_stream_info_err;
+ }
read_size += pkt->size;
OpenPOWER on IntegriCloud