mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Atrac: Clamp packets to valid data.
In case we don't have full valid data yet, return only the part of the data that is valid. This allows FFmpeg to decode data it already has, as necessary.
This commit is contained in:
parent
cdca0492a4
commit
dafb15d96e
1 changed files with 2 additions and 2 deletions
|
@ -428,12 +428,12 @@ struct Atrac {
|
|||
|
||||
bool FillPacket() {
|
||||
u32 off = getFileOffsetBySample(currentSample);
|
||||
if (off < first.filesize) {
|
||||
if (off < first.size) {
|
||||
#ifdef USE_FFMPEG
|
||||
av_init_packet(packet);
|
||||
#endif // USE_FFMPEG
|
||||
packet->data = data_buf + off;
|
||||
packet->size = atracBytesPerFrame;
|
||||
packet->size = std::min((u32)atracBytesPerFrame, first.size - off);
|
||||
packet->pos = off;
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue