From 1c1868682e4923e9c8c6fccb477c274a4a86ec17 Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Tue, 15 Mar 2011 10:59:23 +0100 Subject: [PATCH] dvdsubdec: Output only a single buffer per subpicture and set the correct duration Fixes bug #619136. --- gst/dvdsub/gstdvdsubdec.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gst/dvdsub/gstdvdsubdec.c b/gst/dvdsub/gstdvdsubdec.c index 5a2a24ed82..5b53f39eeb 100644 --- a/gst/dvdsub/gstdvdsubdec.c +++ b/gst/dvdsub/gstdvdsubdec.c @@ -734,13 +734,20 @@ gst_send_subtitle_frame (GstDvdSubDec * dec, GstClockTime end_ts) dec->out_buffer = out_buf; dec->buf_dirty = FALSE; + } else { + goto out; } out_buf = gst_buffer_create_sub (dec->out_buffer, 0, GST_BUFFER_SIZE (dec->out_buffer)); GST_BUFFER_TIMESTAMP (out_buf) = dec->next_ts; - GST_BUFFER_DURATION (out_buf) = GST_CLOCK_DIFF (dec->next_ts, end_ts); + if (GST_CLOCK_TIME_IS_VALID (dec->next_event_ts)) { + GST_BUFFER_DURATION (out_buf) = GST_CLOCK_DIFF (dec->next_ts, + dec->next_event_ts); + } else { + GST_BUFFER_DURATION (out_buf) = GST_CLOCK_TIME_NONE; + } GST_DEBUG_OBJECT (dec, "Sending subtitle buffer with ts %" GST_TIME_FORMAT ", dur %" G_GINT64_FORMAT,