mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-23 19:31:44 +00:00
The queue for native MPEG4 must also be flushed if it contains two I/P frames and the next frame is an I or P frame.
This commit is contained in:
parent
3513341664
commit
41f5e7af68
@ -414,20 +414,24 @@ void
|
||||
mpeg4_p2_video_packetizer_c::flush_frames_maybe(frame_type_e next_frame) {
|
||||
int i, num_bframes;
|
||||
|
||||
if (0 == queued_frames.size())
|
||||
if ((0 == queued_frames.size()) || (FRAME_TYPE_B == next_frame))
|
||||
return;
|
||||
|
||||
if ((FRAME_TYPE_I == next_frame) ||
|
||||
(FRAME_TYPE_P == queued_frames[0].type)) {
|
||||
flush_frames();
|
||||
return;
|
||||
}
|
||||
|
||||
num_bframes = 0;
|
||||
for (i = 0; i < queued_frames.size(); ++i)
|
||||
if (FRAME_TYPE_B == queued_frames[i].type)
|
||||
++num_bframes;
|
||||
|
||||
if ((FRAME_TYPE_I == next_frame) ||
|
||||
(num_bframes > 0) || (FRAME_TYPE_P == queued_frames[0].type))
|
||||
if ((0 < num_bframes) || (2 <= queued_frames.size()))
|
||||
flush_frames();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
mpeg4_p2_video_packetizer_c::flush_frames() {
|
||||
int i, num_bframes, b_offset;
|
||||
|
Loading…
Reference in New Issue
Block a user