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.
This commit is contained in:
Tim-Philipp Müller 2006-04-20 17:48:29 +00:00
parent 6470f4c597
commit 946f3b7938
2 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2006-04-20 Tim-Philipp Müller <tim at centricular dot net>
* ext/flac/gstflacdec.c: (gst_flac_dec_loop):
Post SEGMENT_DONE message in TIME format.
2006-04-20 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Fabrizio Gennari <fabrizio dot ge at tiscali dot it>

View file

@ -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;
}