Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 1a314c73992979a9b10bbf0369a14aad5742c1b0 Mon Sep 17 00:00:00 2001
- From: Joakim Plate <elupus@ecce.se>
- Date: Fri, 13 Dec 2013 22:13:39 +0100
- Subject: [PATCH 1/1] mpegts: speed up find_stream_info for mpegts
- This disable NOHEADER after finding PMT, find_stream_info
- will always exhaust probe size for mpegts since this flag
- is set.
- This is very problematically for live streams since read speed
- will be limited. rtsp, udp and any protocol streaming a live
- mpegts will have dramatically faster startup time.
- ---
- lib/ffmpeg/libavformat/mpegts.c | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
- diff --git a/lib/ffmpeg/libavformat/mpegts.c b/lib/ffmpeg/libavformat/mpegts.c
- index 4f25686..6545ba1 100644
- --- a/lib/ffmpeg/libavformat/mpegts.c
- +++ b/lib/ffmpeg/libavformat/mpegts.c
- @@ -1531,6 +1531,9 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
- if (!ts->stream->nb_streams)
- ts->stop_parse = 2;
- + // stop find_stream_info from waiting for more streams
- + ts->stream->ctx_flags &= ~AVFMTCTX_NOHEADER;
- +
- for(;;) {
- st = 0;
- pes = NULL;
- @@ -2080,6 +2083,8 @@ static int mpegts_read_header(AVFormatContext *s)
- ts->stream = s;
- ts->auto_guess = 0;
- + s->ctx_flags |= AVFMTCTX_NOHEADER;
- +
- if (s->iformat == &ff_mpegts_demuxer) {
- /* normal demux */
- @@ -2100,11 +2105,6 @@ static int mpegts_read_header(AVFormatContext *s)
- ts->auto_guess = 1;
- av_dlog(ts->stream, "tuning done\n");
- -
- - /* only flag NOHEADER if we are in file mode,
- - in streaming mode scanning may take too long for users */
- - if (pb->seekable)
- - s->ctx_flags |= AVFMTCTX_NOHEADER;
- } else {
- AVStream *st;
- int pcr_pid, pid, nb_packets, nb_pcrs, ret, pcr_l;
- --
- 1.8.2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement