mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 14:06:23 +00:00
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1396>
This commit is contained in:
parent
c94675f1d4
commit
31d5d04bb1
1 changed files with 8 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue