summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2019-06-19 15:44:49 +0300
committerSebastian Dröge <sebastian@centricular.com>2019-06-19 15:44:49 +0300
commit2596e5bd6f1f1d51331f5e7e7f1fa98e4ed02d30 (patch)
tree6ac33993e06b3b544ac7bfe28e1f73602f56ac10
parent6359385df5c61848c8b11d5ef73bb3ac23e2d96b (diff)
avvidenc: Also set the repeat_pict flag correctly and take the TFF flag from caps if available
-rw-r--r--ext/libav/gstavvidenc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/libav/gstavvidenc.c b/ext/libav/gstavvidenc.c
index 4dbeea9..621d00b 100644
--- a/ext/libav/gstavvidenc.c
+++ b/ext/libav/gstavvidenc.c
@@ -560,9 +560,12 @@ gst_ffmpegvidenc_send_frame (GstFFMpegVidEnc * ffmpegenc,
if (GST_VIDEO_INFO_IS_INTERLACED (&ffmpegenc->input_state->info)) {
picture->interlaced_frame = TRUE;
- /* if this is not the case, a filter element should be used to swap fields */
picture->top_field_first =
- GST_BUFFER_FLAG_IS_SET (frame->input_buffer, GST_VIDEO_BUFFER_FLAG_TFF);
+ GST_BUFFER_FLAG_IS_SET (frame->input_buffer, GST_VIDEO_BUFFER_FLAG_TFF)
+ || GST_VIDEO_INFO_FIELD_ORDER (&ffmpegenc->input_state->info) ==
+ GST_VIDEO_FIELD_ORDER_TOP_FIELD_FIRST;
+ picture->repeat_pict =
+ GST_BUFFER_FLAG_IS_SET (frame->input_buffer, GST_VIDEO_BUFFER_FLAG_RFF);
}
if (GST_VIDEO_INFO_MULTIVIEW_MODE (info) != GST_VIDEO_MULTIVIEW_MODE_NONE) {