From cee10cb439afa1cb74db5c62884d4999a4c1afac Mon Sep 17 00:00:00 2001 From: Tim-Philipp Müller Date: Sat, 1 Aug 2009 17:07:42 +0100 Subject: flacdec: send newsegment event when operating push-based and unframed For some reason flac doesn't call our metadata callback when we operate in push mode with unframed input, but that's where we set up the newsegment event (since that's where we'd get the duration from the stream info header), so we didn't send a newsegment event at all in this case. Hack around this by storing a generic newsegment event for now which will be used if we don't replace it with a better one that includes the duration. --- ext/flac/gstflacdec.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ext') diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c index 4433a1ac1..31c5f853d 100644 --- a/ext/flac/gstflacdec.c +++ b/ext/flac/gstflacdec.c @@ -1247,6 +1247,13 @@ gst_flac_dec_sink_event (GstPad * pad, GstEvent * event) GST_DEBUG_OBJECT (dec, "newsegment event in %s format => not framed", gst_format_get_name (fmt)); dec->framed = FALSE; + + /* prepare generic newsegment event, for some reason our metadata + * callback where we usually set this up is not being called in + * push mode */ + dec->start_segment = gst_event_new_new_segment (FALSE, 1.0, + GST_FORMAT_TIME, 0, -1, 0); + gst_event_unref (event); res = TRUE; } -- cgit v1.2.3