mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-26 01:40:24 +00:00
Ensure FFmpeg doesn't corrupt an early keyframe.
When the analyze func runs, it seems to check between 2-4% (or so?) of the stream, which for longer videos especially we don't have yet. Returning a read failure here seems to truncate that keyframe sometimes. FFmpeg asks for the total size when this happens, which we were ignoring. Handling it fixes this, as FFmpeg apparently realizes we ran out of data.
This commit is contained in:
parent
34323a1192
commit
2ec8106809
@ -166,6 +166,13 @@ int64_t _MpegSeekbuffer(void *opaque, int64_t offset, int whence)
|
||||
case SEEK_END:
|
||||
mpeg->m_decodeNextPos = mpeg->m_streamSize - (u32)offset;
|
||||
break;
|
||||
|
||||
#ifdef USE_FFMPEG
|
||||
// Don't seek, just return the full size.
|
||||
// Returning this means FFmpeg won't think frames are truncated if we don't have them yet.
|
||||
case AVSEEK_SIZE:
|
||||
return mpeg->m_streamSize;
|
||||
#endif
|
||||
}
|
||||
return offset;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user