mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 11:54:01 +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) {
|
mpeg4_p2_video_packetizer_c::flush_frames_maybe(frame_type_e next_frame) {
|
||||||
int i, num_bframes;
|
int i, num_bframes;
|
||||||
|
|
||||||
if (0 == queued_frames.size())
|
if ((0 == queued_frames.size()) || (FRAME_TYPE_B == next_frame))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if ((FRAME_TYPE_I == next_frame) ||
|
||||||
|
(FRAME_TYPE_P == queued_frames[0].type)) {
|
||||||
|
flush_frames();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
num_bframes = 0;
|
num_bframes = 0;
|
||||||
for (i = 0; i < queued_frames.size(); ++i)
|
for (i = 0; i < queued_frames.size(); ++i)
|
||||||
if (FRAME_TYPE_B == queued_frames[i].type)
|
if (FRAME_TYPE_B == queued_frames[i].type)
|
||||||
++num_bframes;
|
++num_bframes;
|
||||||
|
|
||||||
if ((FRAME_TYPE_I == next_frame) ||
|
if ((0 < num_bframes) || (2 <= queued_frames.size()))
|
||||||
(num_bframes > 0) || (FRAME_TYPE_P == queued_frames[0].type))
|
|
||||||
flush_frames();
|
flush_frames();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
mpeg4_p2_video_packetizer_c::flush_frames() {
|
mpeg4_p2_video_packetizer_c::flush_frames() {
|
||||||
int i, num_bframes, b_offset;
|
int i, num_bframes, b_offset;
|
||||||
|
Loading…
Reference in New Issue
Block a user