summaryrefslogtreecommitdiff
path: root/gst/interlace
diff options
context:
space:
mode:
authorRobert Swain <robert.swain@collabora.co.uk>2010-11-22 15:26:06 +0100
committerRobert Swain <robert.swain@collabora.co.uk>2010-11-24 12:09:16 +0100
commit0de362f248bf0ba5c5f2a7e5e87198f5a17ca60f (patch)
treecec4da82105a64a27e1673d395cc8d8237ddee79 /gst/interlace
parent341b0c2d62ac266319a1f13c8695e23090901290 (diff)
downloadgstreamer-plugins-bad-0de362f248bf0ba5c5f2a7e5e87198f5a17ca60f.tar.gz
interlace: Fix buffer timestamp and duration
The field rate is twice the frame rate of the src pad and so the duration of one output buffer is src_fps_d / (2 * src_fps_n).
Diffstat (limited to 'gst/interlace')
-rw-r--r--gst/interlace/gstinterlace.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gst/interlace/gstinterlace.c b/gst/interlace/gstinterlace.c
index d8b7f2ed3..c6181ecad 100644
--- a/gst/interlace/gstinterlace.c
+++ b/gst/interlace/gstinterlace.c
@@ -327,13 +327,14 @@ static void
gst_interlace_decorate_buffer (GstInterlace * interlace, GstBuffer * buf,
int n_fields)
{
+ /* field duration = src_fps_d / (2 * src_fps_n) */
GST_BUFFER_TIMESTAMP (buf) = interlace->timebase +
gst_util_uint64_scale (GST_SECOND,
interlace->src_fps_d * interlace->fields_since_timebase,
- interlace->src_fps_n);
+ interlace->src_fps_n * 2);
GST_BUFFER_DURATION (buf) =
gst_util_uint64_scale (GST_SECOND, interlace->src_fps_d * n_fields,
- interlace->src_fps_n);
+ interlace->src_fps_n * 2);
/* increment the buffer timestamp by duration for the next buffer */
gst_buffer_set_caps (buf, interlace->srccaps);