mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 03:00:35 +00:00
x264enc: Fix flushing of delayed frames
x264_encoder_encode() should be called with a NULL picture until at least x264_encoder_delayed_frames() returns 0. This fixes what appeared to be a regression in make check due to the recent change in defaults which enabled b-frames and b-pyramid, both of which I believe increase the number of delayed frames when encoding.
This commit is contained in:
parent
60d647dcf5
commit
a441e5b6ef
1 changed files with 10 additions and 0 deletions
|
@ -75,6 +75,10 @@
|
|||
|
||||
#include "gstx264enc.h"
|
||||
|
||||
#if X264_BUILD >= 71
|
||||
#define X264_DELAYED_FRAMES_API
|
||||
#endif
|
||||
|
||||
#if X264_BUILD >= 76
|
||||
#define X264_ENC_NALS 1
|
||||
#endif
|
||||
|
@ -1628,7 +1632,13 @@ gst_x264_enc_flush_frames (GstX264Enc * encoder, gboolean send)
|
|||
if (encoder->x264enc)
|
||||
do {
|
||||
flow_ret = gst_x264_enc_encode_frame (encoder, NULL, &i_nal, send);
|
||||
#ifdef X264_DELAYED_FRAMES_API
|
||||
} while (flow_ret == GST_FLOW_OK
|
||||
&& x264_encoder_delayed_frames (encoder->x264enc) > 0);
|
||||
#else
|
||||
/* note that this doesn't flush all frames for > 1 delayed frame */
|
||||
} while (flow_ret == GST_FLOW_OK && i_nal > 0);
|
||||
#endif
|
||||
|
||||
/* in any case, make sure the delay queue is emptied */
|
||||
while (!g_queue_is_empty (encoder->delay))
|
||||
|
|
Loading…
Reference in a new issue