mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-01 18:21:04 +00:00
ffmdec: set avio buffer to ffm->packet_size, avoid dirty reads
This commit is contained in:
parent
0b99e858d1
commit
8ba987bff3
@ -121,6 +121,11 @@ static int ffm_read_data(AVFormatContext *s,
|
|||||||
if (avio_tell(pb) == ffm->file_size)
|
if (avio_tell(pb) == ffm->file_size)
|
||||||
avio_seek(pb, ffm->packet_size, SEEK_SET);
|
avio_seek(pb, ffm->packet_size, SEEK_SET);
|
||||||
retry_read:
|
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 */
|
id = avio_rb16(pb); /* PACKET_ID */
|
||||||
if (id != PACKET_ID)
|
if (id != PACKET_ID)
|
||||||
if (ffm_resync(s, id) < 0)
|
if (ffm_resync(s, id) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user