History

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).

aybe aybe committed 2 years ago

Commit f89a6e71 parent 21ed5291 file · +5 −1Browse files

Showing the changes to libavformat (1 of 1 file). Show all

Unified · Split

libavformat/psxstr.c+5−1
@@ -166,8 +166,12 @@ static int str_read_packet(AVFormatContext *s, · 165 unmodified lines
166 AVStream *st;166 AVStream *st;
167 167
168 while (1) {168 while (1) {
169 int read = avio_read(pb, sector, RAW_CD_SECTOR_SIZE);
169 170
170 if (avio_read(pb, sector, RAW_CD_SECTOR_SIZE) != RAW_CD_SECTOR_SIZE)171 if (read == AVERROR_EOF)
172 return AVERROR_EOF;
173
174 if (read != RAW_CD_SECTOR_SIZE)
171 return AVERROR(EIO);175 return AVERROR(EIO);
172 176
173 channel = sector[0x11];177 channel = sector[0x11];

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t