Commit 31d5d04b authored by Vivia Nikolaidou's avatar Vivia Nikolaidou 🦆 Committed by GStreamer Merge Bot

videoparseutils: Only add a single closed caption meta

Otherwise, having a stream go through a parser multiple times would
result in duplicate closed caption meta.

Part-of: <!1396>
parent c94675f1
Pipeline #171153 failed with stages
in 1 minute and 12 seconds
......@@ -252,9 +252,14 @@ gst_video_push_user_data (GstElement * elt, GstVideoParseUserData * user_data,
/* 1. handle closed captions */
if (user_data->closedcaptions_size > 0) {
gst_buffer_add_video_caption_meta (buf,
user_data->closedcaptions_type, user_data->closedcaptions,
user_data->closedcaptions_size);
if (!gst_buffer_get_meta (buf, GST_VIDEO_CAPTION_META_API_TYPE)) {
gst_buffer_add_video_caption_meta (buf,
user_data->closedcaptions_type, user_data->closedcaptions,
user_data->closedcaptions_size);
} else {
GST_DEBUG_OBJECT (elt, "Closed caption data already found on buffer, "
"discarding to avoid duplication");
}
user_data->closedcaptions_type = GST_VIDEO_CAPTION_TYPE_UNKNOWN;
user_data->closedcaptions_size = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment