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.
This commit is contained in:
wm4 2013-05-24 12:00:44 +02:00
parent 137c1032fa
commit 3face4300e
1 changed files with 6 additions and 0 deletions

View File

@ -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)))