From 946f3b7938495233156ba7f5f16a75d860981442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 20 Apr 2006 17:48:29 +0000 Subject: [PATCH] ext/flac/gstflacdec.c: Post SEGMENT_DONE message in TIME format. Original commit message from CVS: * ext/flac/gstflacdec.c: (gst_flac_dec_loop): Post SEGMENT_DONE message in TIME format. --- ChangeLog | 5 +++++ ext/flac/gstflacdec.c | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 26b48d64dd..d9ac93dec1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-04-20 Tim-Philipp Müller + + * ext/flac/gstflacdec.c: (gst_flac_dec_loop): + Post SEGMENT_DONE message in TIME format. + 2006-04-20 Tim-Philipp Müller Patch by: Fabrizio Gennari diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c index c174562b83..946d9b3874 100644 --- a/ext/flac/gstflacdec.c +++ b/ext/flac/gstflacdec.c @@ -791,15 +791,21 @@ analyze_state: if (flacdec->segment.stop != -1 && flacdec->segment.last_stop > 0 && flacdec->segment.last_stop >= flacdec->segment.stop) { + gint64 stop_time; + GST_DEBUG_OBJECT (flacdec, "reached end of the configured segment"); if ((flacdec->segment.flags & GST_SEEK_FLAG_SEGMENT) == 0) goto eos_and_pause; GST_DEBUG_OBJECT (flacdec, "posting SEGMENT_DONE message"); + + stop_time = gst_util_uint64_scale_int (flacdec->segment.stop, + GST_SECOND, flacdec->sample_rate); + gst_element_post_message (GST_ELEMENT (flacdec), gst_message_new_segment_done (GST_OBJECT (flacdec), - GST_FORMAT_DEFAULT, flacdec->segment.stop)); + GST_FORMAT_TIME, stop_time)); goto pause; }