mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-28 16:30:54 +01:00
Fix FFmpeg reader function
It should return AVERROR_EOF when reaching the end of the stream, rather than returning zero. When it returns zero, the avformat prober will just loop endlessly until the process is terminated. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
parent
0415b263a3
commit
2db8e56ef2
@ -218,7 +218,7 @@ static int ffmpeg_read(void* opaque, uint8_t* buf, int read_size) {
|
||||
if (data->logical_offset + read_size > data->logical_size)
|
||||
read_size = data->logical_size - data->logical_offset;
|
||||
if (read_size == 0)
|
||||
return bytes;
|
||||
return AVERROR_EOF;
|
||||
|
||||
/* handle reads on inserted header */
|
||||
if (data->header_size && data->logical_offset < data->header_size) {
|
||||
@ -232,7 +232,7 @@ static int ffmpeg_read(void* opaque, uint8_t* buf, int read_size) {
|
||||
data->logical_offset += max_to_copy;
|
||||
|
||||
if (read_size == 0) {
|
||||
return max_to_copy; /* offset still in header */
|
||||
return max_to_copy ? max_to_copy : AVERROR_EOF; /* offset still in header */
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user