diff options
author | fritsch <peter.fruehberger@gmail.com> | 2014-12-31 11:10:14 +0100 |
---|---|---|
committer | fritsch <peter.fruehberger@gmail.com> | 2014-12-31 15:51:58 +0100 |
commit | f4dbc05059ed55f1442d6d044294f8a0802bc481 (patch) | |
tree | 0191f292596807c8de7165339c74cd72f6642108 | |
parent | 8d8946df2e3b833073c3adc2de32af9c1abc971c (diff) |
DVDDemuxFFmpeg: Take care of av_probe changing buffer_size fixes #15659
-rw-r--r-- | xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp index ba9afd5a78..c2a2134e9f 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -306,8 +306,10 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput, bool streaminfo, bool filein pd.buf = probe_buffer; pd.filename = strFile.c_str(); + // av_probe_input_buffer might have changed the buffer_size beyond our allocated amount + int buffer_size = std::min((int) FFMPEG_FILE_BUFFER_SIZE, m_ioContext->buffer_size); // read data using avformat's buffers - pd.buf_size = avio_read(m_ioContext, pd.buf, m_ioContext->max_packet_size ? m_ioContext->max_packet_size : m_ioContext->buffer_size); + pd.buf_size = avio_read(m_ioContext, pd.buf, m_ioContext->max_packet_size ? m_ioContext->max_packet_size : buffer_size); if (pd.buf_size <= 0) { CLog::Log(LOGERROR, "%s - error reading from input stream, %s", __FUNCTION__, CURL::GetRedacted(strFile).c_str()); @@ -1744,4 +1746,4 @@ void CDVDDemuxFFmpeg::GetL16Parameters(int &channels, int &samplerate) } } } -}
\ No newline at end of file +} |