mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 14:36:24 +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 */
|
/* 1. handle closed captions */
|
||||||
if (user_data->closedcaptions_size > 0) {
|
if (user_data->closedcaptions_size > 0) {
|
||||||
|
if (!gst_buffer_get_meta (buf, GST_VIDEO_CAPTION_META_API_TYPE)) {
|
||||||
gst_buffer_add_video_caption_meta (buf,
|
gst_buffer_add_video_caption_meta (buf,
|
||||||
user_data->closedcaptions_type, user_data->closedcaptions,
|
user_data->closedcaptions_type, user_data->closedcaptions,
|
||||||
user_data->closedcaptions_size);
|
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_type = GST_VIDEO_CAPTION_TYPE_UNKNOWN;
|
||||||
user_data->closedcaptions_size = 0;
|
user_data->closedcaptions_size = 0;
|
||||||
|
|
Loading…
Reference in a new issue