Skip to content

Commit f06235c

Browse files
jehuttingpopcornmix
authored andcommitted
Fix FFmpeg 4.0 causes omxplayer to hang-up at the end. (popcornmix#637)
1 parent 9ca4561 commit f06235c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

OMXReader.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,14 @@ static int dvd_file_read(void *h, uint8_t* buf, int size)
118118
return -1;
119119

120120
XFILE::CFile *pFile = (XFILE::CFile *)h;
121-
return pFile->Read(buf, size);
121+
int ret = pFile->Read(buf, size);
122+
123+
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58,12,100)
124+
if (ret == 0 && pFile->IsEOF())
125+
ret = AVERROR_EOF;
126+
#endif
127+
128+
return ret;
122129
}
123130

124131
static offset_t dvd_file_seek(void *h, offset_t pos, int whence)

0 commit comments

Comments
 (0)