summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2021-07-15 21:10:14 +0200
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-08-30 21:27:44 +0000
commit20483c3449e44d989d1d1f40ffc88dc3a6249ded (patch)
treefd9c51dbfd8f591dc21b773c5cd61ec652cd27e0 /ext
parent52fff41aaea765de4beace843ad065c4cb1c27d7 (diff)
downloadgstreamer-plugins-bad-20483c3449e44d989d1d1f40ffc88dc3a6249ded.tar.gz
cccombiner: fix scheduling with interlaced video buffers
The initial code was written with the misunderstanding that IS_TOP_FIELD indicated that an interlaced buffer contained a top field, not that it contained only a top field Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2413>
Diffstat (limited to 'ext')
-rw-r--r--ext/closedcaption/gstcccombiner.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/closedcaption/gstcccombiner.c b/ext/closedcaption/gstcccombiner.c
index d0bb23c72..07d073e98 100644
--- a/ext/closedcaption/gstcccombiner.c
+++ b/ext/closedcaption/gstcccombiner.c
@@ -853,7 +853,7 @@ gst_cc_combiner_collect_captions (GstCCCombiner * self, gboolean timeout)
/* Only relevant in alternate and mixed mode, no need to look at the caps */
if (GST_BUFFER_FLAG_IS_SET (self->current_video_buffer,
GST_VIDEO_BUFFER_FLAG_INTERLACED)) {
- if (GST_VIDEO_BUFFER_IS_TOP_FIELD (self->current_video_buffer)) {
+ if (!GST_VIDEO_BUFFER_IS_BOTTOM_FIELD (self->current_video_buffer)) {
dequeue_caption (self, tc, 0);
}
} else {
@@ -867,11 +867,12 @@ gst_cc_combiner_collect_captions (GstCCCombiner * self, gboolean timeout)
if (self->progressive) {
dequeue_caption (self, tc, 0);
} else if (GST_BUFFER_FLAG_IS_SET (self->current_video_buffer,
- GST_VIDEO_BUFFER_FLAG_INTERLACED)) {
+ GST_VIDEO_BUFFER_FLAG_INTERLACED) &&
+ GST_BUFFER_FLAG_IS_SET (self->current_video_buffer,
+ GST_VIDEO_BUFFER_FLAG_ONEFIELD)) {
if (GST_VIDEO_BUFFER_IS_TOP_FIELD (self->current_video_buffer)) {
dequeue_caption (self, tc, 0);
- }
- if (GST_VIDEO_BUFFER_IS_BOTTOM_FIELD (self->current_video_buffer)) {
+ } else {
dequeue_caption (self, tc, 1);
}
} else {
@@ -886,7 +887,7 @@ gst_cc_combiner_collect_captions (GstCCCombiner * self, gboolean timeout)
dequeue_caption (self, tc, 0);
} else if (GST_BUFFER_FLAG_IS_SET (self->current_video_buffer,
GST_VIDEO_BUFFER_FLAG_INTERLACED)) {
- if (GST_VIDEO_BUFFER_IS_TOP_FIELD (self->current_video_buffer)) {
+ if (!GST_VIDEO_BUFFER_IS_BOTTOM_FIELD (self->current_video_buffer)) {
dequeue_caption (self, tc, 0);
}
} else {