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).
Showing the changes to libavformat (1 of 1 file). Show all
Unified · Split
| @@ -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]; |