File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -89,13 +89,15 @@ bool AudioDecoder::decodeNextFrame(Frame& frameBuffer)
89
89
90
90
const bool nextPacketRead = _inputStream->readNextPacket (data);
91
91
// if error or end of file
92
- if (!nextPacketRead)
92
+ if (!nextPacketRead && !decodeNextFrame )
93
93
{
94
94
data.clear ();
95
95
return false ;
96
96
}
97
97
98
98
// decoding
99
+ // @note could be called several times to return the remaining frames (last call with an empty packet)
100
+ // @see CODEC_CAP_DELAY
99
101
int ret = avcodec_decode_audio4 (&_inputStream->getAudioCodec ().getAVCodecContext (), &frameBuffer.getAVFrame (),
100
102
&got_frame, &data.getAVPacket ());
101
103
if (ret < 0 )
Original file line number Diff line number Diff line change @@ -87,13 +87,15 @@ bool VideoDecoder::decodeNextFrame(Frame& frameBuffer)
87
87
88
88
const bool nextPacketRead = _inputStream->readNextPacket (data);
89
89
// if error or end of file
90
- if (!nextPacketRead)
90
+ if (!nextPacketRead && !decodeNextFrame )
91
91
{
92
92
data.clear ();
93
93
return false ;
94
94
}
95
95
96
96
// decoding
97
+ // @note could be called several times to return the remaining frames (last call with an empty packet)
98
+ // @see CODEC_CAP_DELAY
97
99
const int ret = avcodec_decode_video2 (&_inputStream->getVideoCodec ().getAVCodecContext (), &frameBuffer.getAVFrame (),
98
100
&got_frame, &data.getAVPacket ());
99
101
if (ret < 0 )
You can’t perform that action at this time.
0 commit comments