mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
basevideoencoder: Fix handling of force-keyunit events
This commit is contained in:
parent
bab4c11b4c
commit
fd828c4ac7
1 changed files with 28 additions and 25 deletions
|
@ -1001,8 +1001,8 @@ gst_base_video_encoder_finish_frame (GstBaseVideoEncoder * base_video_encoder,
|
|||
for (l = base_video_encoder->force_key_unit; l; l = l->next) {
|
||||
ForcedKeyUnitEvent *tmp = l->data;
|
||||
|
||||
/* Skip pending keyunits */
|
||||
if (tmp->pending)
|
||||
/* Skip non-pending keyunits */
|
||||
if (!tmp->pending)
|
||||
continue;
|
||||
|
||||
/* Simple case, keyunit ASAP */
|
||||
|
@ -1017,13 +1017,14 @@ gst_base_video_encoder_finish_frame (GstBaseVideoEncoder * base_video_encoder,
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (fevt) {
|
||||
base_video_encoder->force_key_unit =
|
||||
g_list_remove (base_video_encoder->force_key_unit, fevt);
|
||||
}
|
||||
GST_OBJECT_UNLOCK (base_video_encoder);
|
||||
|
||||
/* Should really be here */
|
||||
g_assert (fevt);
|
||||
|
||||
if (fevt) {
|
||||
stream_time =
|
||||
gst_segment_to_stream_time (&GST_BASE_VIDEO_CODEC
|
||||
(base_video_encoder)->segment, GST_FORMAT_TIME,
|
||||
|
@ -1033,7 +1034,8 @@ gst_base_video_encoder_finish_frame (GstBaseVideoEncoder * base_video_encoder,
|
|||
(frame->presentation_timestamp, stream_time, running_time,
|
||||
fevt->all_headers, fevt->count);
|
||||
|
||||
gst_pad_push_event (GST_BASE_VIDEO_CODEC_SRC_PAD (base_video_encoder), ev);
|
||||
gst_pad_push_event (GST_BASE_VIDEO_CODEC_SRC_PAD (base_video_encoder),
|
||||
ev);
|
||||
|
||||
if (fevt->all_headers) {
|
||||
if (base_video_encoder->headers) {
|
||||
|
@ -1048,6 +1050,7 @@ gst_base_video_encoder_finish_frame (GstBaseVideoEncoder * base_video_encoder,
|
|||
GST_TIME_ARGS (running_time), fevt->all_headers, fevt->count);
|
||||
forced_key_unit_event_free (fevt);
|
||||
}
|
||||
}
|
||||
|
||||
if (frame->is_sync_point) {
|
||||
base_video_encoder->distance_from_sync = 0;
|
||||
|
|
Loading…
Reference in a new issue