Mercurial > mplayer.hg
changeset 29840:efa22f9d6b76
Allow lavf demuxer to also probe and play files < 32 kB (full probe buffer size).
Based on patch by On2.
author | reimar |
---|---|
date | Tue, 10 Nov 2009 16:49:00 +0000 |
parents | a2a009b24502 |
children | bfbcbf7deb57 |
files | libmpdemux/demux_lavf.c |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c Tue Nov 10 16:24:16 2009 +0000 +++ b/libmpdemux/demux_lavf.c Tue Nov 10 16:49:00 2009 +0000 @@ -133,6 +133,7 @@ AVProbeData avpd; uint8_t buf[PROBE_BUF_SIZE]; lavf_priv_t *priv; + int probe_data_size; if(!demuxer->priv) demuxer->priv=calloc(sizeof(lavf_priv_t),1); @@ -154,11 +155,12 @@ return DEMUXER_TYPE_LAVF; } - if(stream_read(demuxer->stream, buf, PROBE_BUF_SIZE)!=PROBE_BUF_SIZE) + probe_data_size = stream_read(demuxer->stream, buf, PROBE_BUF_SIZE); + if(probe_data_size <= 0) return 0; avpd.filename= demuxer->stream->url; avpd.buf= buf; - avpd.buf_size= PROBE_BUF_SIZE; + avpd.buf_size= probe_data_size; priv->avif= av_probe_input_format(&avpd, 1); if(!priv->avif){