+2007-12-18 Wim Taymans <wim.taymans@collabora.co.uk>
+
+ * ext/flac/gstflacdec.c: (gst_flac_dec_reset_decoders),
+ (gst_flac_dec_update_metadata), (gst_flac_dec_metadata_callback),
+ (gst_flac_dec_write):
+ * ext/flac/gstflacdec.h:
+ Remove some unused vars.
+ Do more cleanup of leftover events and tags.
+ Output tags after the segment event. Fixes #504018.
+
2007-12-18 Tim-Philipp Müller <tim at centricular dot net>
* gst/avi/gstavisubtitle.c: (IS_BOM_UTF8), (IS_BOM_UTF16_BE),
flacdec->adapter = NULL;
}
+ if (flacdec->close_segment) {
+ gst_event_unref (flacdec->close_segment);
+ flacdec->close_segment = NULL;
+ }
+ if (flacdec->start_segment) {
+ gst_event_unref (flacdec->start_segment);
+ flacdec->start_segment = NULL;
+ }
+ if (flacdec->tags) {
+ gst_tag_list_free (flacdec->tags);
+ flacdec->tags = NULL;
+ }
+
flacdec->segment.last_stop = 0;
flacdec->offset = 0;
flacdec->init = TRUE;
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
GST_TAG_AUDIO_CODEC, "FLAC", NULL);
- gst_element_found_tags_for_pad (GST_ELEMENT (flacdec), flacdec->srcpad, list);
+ if (flacdec->tags)
+ gst_tag_list_free (flacdec->tags);
+ flacdec->tags = list;
+
return TRUE;
}
"rate", G_TYPE_INT, frame->header.sample_rate,
"channels", G_TYPE_INT, channels, NULL);
- if (!gst_pad_set_caps (flacdec->srcpad, caps)) {
- GST_ELEMENT_ERROR (flacdec, CORE, NEGOTIATION, (NULL),
- ("Failed to negotiate caps %" GST_PTR_FORMAT, caps));
- flacdec->last_flow = GST_FLOW_ERROR;
- gst_caps_unref (caps);
- return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
- }
-
- gst_caps_unref (caps);
-
flacdec->depth = depth;
flacdec->width = width;
flacdec->channels = channels;
flacdec->sample_rate = frame->header.sample_rate;
+
+ gst_pad_set_caps (flacdec->srcpad, caps);
+ gst_caps_unref (caps);
}
if (flacdec->close_segment) {
flacdec->start_segment = NULL;
}
+ if (flacdec->tags) {
+ gst_element_found_tags_for_pad (GST_ELEMENT (flacdec), flacdec->srcpad,
+ flacdec->tags);
+ flacdec->tags = NULL;
+ }
+
ret = gst_pad_alloc_buffer_and_set_caps (flacdec->srcpad,
flacdec->segment.last_stop, samples * channels * (width / 8),
GST_PAD_CAPS (flacdec->srcpad), &outbuf);
GST_DEBUG_OBJECT (dec, "newsegment event in TIME format => framed");
dec->framed = TRUE;
res = gst_pad_push_event (dec->srcpad, event);
- dec->need_newsegment = FALSE;
/* this won't work for the first newsegment event though ... */
if (gst_flac_dec_convert_src (dec->srcpad, GST_FORMAT_TIME, cur,
GST_DEBUG_OBJECT (dec, "newsegment event in %s format => not framed",
gst_format_get_name (fmt));
dec->framed = FALSE;
- dec->need_newsegment = TRUE;
gst_event_unref (event);
res = TRUE;
}
switch (transition) {
case GST_STATE_CHANGE_READY_TO_PAUSED:
- flacdec->segment.last_stop = 0;
- flacdec->need_newsegment = TRUE;
flacdec->seeking = FALSE;
flacdec->channels = 0;
flacdec->depth = 0;