mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Audiocodec: Update to latest FFmpeg packet pump.
This commit is contained in:
parent
2b2dae60d3
commit
b19e39efb0
1 changed files with 18 additions and 0 deletions
|
@ -192,7 +192,25 @@ bool SimpleAudio::Decode(void *inbuf, int inbytes, uint8_t *outbuf, int *outbyte
|
|||
|
||||
*outbytes = 0;
|
||||
srcPos = 0;
|
||||
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
|
||||
if (inbytes != 0) {
|
||||
int err = avcodec_send_packet(codecCtx_, &packet);
|
||||
if (err < 0) {
|
||||
ERROR_LOG(ME, "Error sending audio frame to decoder (%d bytes): %d (%08x)", inbytes, err, err);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
int err = avcodec_receive_frame(codecCtx_, frame_);
|
||||
int len = 0;
|
||||
if (err >= 0) {
|
||||
len = frame_->pkt_size;
|
||||
got_frame = 1;
|
||||
} else if (err != AVERROR(EAGAIN)) {
|
||||
len = err;
|
||||
}
|
||||
#else
|
||||
int len = avcodec_decode_audio4(codecCtx_, frame_, &got_frame, &packet);
|
||||
#endif
|
||||
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 12, 100)
|
||||
av_packet_unref(&packet);
|
||||
#else
|
||||
|
|
Loading…
Add table
Reference in a new issue