From 3face4300ed01d0b9394efab4dfdcf997cc48704 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 24 May 2013 12:00:44 +0200 Subject: [PATCH] demux_lavf: print how many bytes are read by avformat_find_stream_info() Can be helpful for debugging slow stream startup. Also add a comment about BIO_BUFFER_SIZE. --- demux/demux_lavf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 5eebffc2f9..2141d3ab0a 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -61,6 +61,8 @@ const m_option_t lavfdopts_conf[] = { {NULL, NULL, 0, 0, 0, 0, NULL} }; +// Should correspond to IO_BUFFER_SIZE in libavformat/aviobuf.c (not public) +// libavformat (almost) always reads data in blocks of this size. #define BIO_BUFFER_SIZE 32768 typedef struct lavf_priv { @@ -524,6 +526,10 @@ static demuxer_t *demux_open_lavf(demuxer_t *demuxer) "LAVF_header: av_find_stream_info() failed\n"); return NULL; } + + mp_msg(MSGT_HEADER, MSGL_V, "demux_lavf: avformat_find_stream_info() " + "finished after %"PRId64" bytes.\n", stream_tell(demuxer->stream)); + /* Add metadata. */ while ((t = av_dict_get(avfc->metadata, "", t, AV_DICT_IGNORE_SUFFIX)))