diff options
author | Yan Jing <yanjng@21cn.com> | 2011-09-08 20:23:13 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-09-08 20:53:44 +0200 |
commit | 8ba987bff3004de6952ccab90d9b8acc6135a37a (patch) | |
tree | a9f95dea63eb5962d04b05ce3e5e69001cc03c38 /libavformat | |
parent | 0b99e858d1ab8098b67a86c6fe27782ac2265cbe (diff) | |
download | ffmpeg-8ba987bff3004de6952ccab90d9b8acc6135a37a.tar.gz |
ffmdec: set avio buffer to ffm->packet_size, avoid dirty reads
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/ffmdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c index 42c1466e44..feb136a3f6 100644 --- a/libavformat/ffmdec.c +++ b/libavformat/ffmdec.c @@ -121,6 +121,11 @@ static int ffm_read_data(AVFormatContext *s, if (avio_tell(pb) == ffm->file_size) avio_seek(pb, ffm->packet_size, SEEK_SET); retry_read: + if (pb->buffer_size != ffm->packet_size) { + int64_t tell = avio_tell(pb); + url_setbufsize(pb, ffm->packet_size); + avio_seek(pb, tell, SEEK_SET); + } id = avio_rb16(pb); /* PACKET_ID */ if (id != PACKET_ID) if (ffm_resync(s, id) < 0) |