mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 21:39:52 +00:00
Mpeg: Prevent sending flush packets to decode.
This commit is contained in:
parent
ed2610cf1a
commit
d8e3bae2da
@ -994,7 +994,8 @@ static bool decodePmpVideo(PSPPointer<SceMpegRingBuffer> ringbuffer, u32 pmpctxA
|
||||
|
||||
// decode video frame
|
||||
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
|
||||
avcodec_send_packet(pCodecCtx, &packet);
|
||||
if (packet.size != 0)
|
||||
avcodec_send_packet(pCodecCtx, &packet);
|
||||
int len = avcodec_receive_frame(pCodecCtx, pFrame);
|
||||
if (len == 0) {
|
||||
len = pFrame->pkt_size;
|
||||
|
@ -314,7 +314,7 @@ bool MediaEngine::openContext(bool keepReadPos) {
|
||||
|
||||
if (!SetupStreams()) {
|
||||
// Fallback to old behavior. Reads too much and corrupts when game doesn't read fast enough.
|
||||
// SetupStreams should work for newer FFmpeg 3.1+ now.
|
||||
// SetupStreams sometimes work for newer FFmpeg 3.1+ now, but sometimes framerate is missing.
|
||||
WARN_LOG_REPORT_ONCE(setupStreams, ME, "Failed to read valid video stream data from header");
|
||||
if (avformat_find_stream_info(m_pFormatCtx, nullptr) < 0) {
|
||||
closeContext();
|
||||
@ -677,7 +677,8 @@ bool MediaEngine::stepVideo(int videoPixelMode, bool skipFrame) {
|
||||
#endif
|
||||
|
||||
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
|
||||
avcodec_send_packet(m_pCodecCtx, &packet);
|
||||
if (packet.size != 0)
|
||||
avcodec_send_packet(m_pCodecCtx, &packet);
|
||||
int result = avcodec_receive_frame(m_pCodecCtx, m_pFrame);
|
||||
if (result == 0) {
|
||||
result = m_pFrame->pkt_size;
|
||||
|
Loading…
Reference in New Issue
Block a user