avformat/psxstr: fix demuxing I/O error at EOF

This second patch fixes the following error at the end of a .STR stream conversion:

[in#0/psxstr @ 0000000000681e80] Error during demuxing: I/O error

It's been a bit of trial and error as I've never used ffmpeg, but returning AVERROR_EOF appears to be the way to go (doesn't complain anymore).

Signed-off-by: aybe <aybe@users.noreply.github.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
aybe aybe 2024-01-02 02:52:11 +00:00 committed by Michael Niedermayer
parent 21ed52916d
commit f89a6e7576
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 5 additions and 1 deletions

View File

@ -166,8 +166,12 @@ static int str_read_packet(AVFormatContext *s,
AVStream *st; AVStream *st;
while (1) { while (1) {
int read = avio_read(pb, sector, RAW_CD_SECTOR_SIZE);
if (avio_read(pb, sector, RAW_CD_SECTOR_SIZE) != RAW_CD_SECTOR_SIZE) if (read == AVERROR_EOF)
return AVERROR_EOF;
if (read != RAW_CD_SECTOR_SIZE)
return AVERROR(EIO); return AVERROR(EIO);
channel = sector[0x11]; channel = sector[0x11];