+2006-02-04 Tim-Philipp Müller <tim at centricular dot net>
+
+ * gst/avi/gstavidemux.c: (gst_avi_demux_parse_stream),
+ (gst_avi_demux_all_source_pads_unlinked),
+ (gst_avi_demux_process_next_entry):
+ * gst/avi/gstavidemux.h:
+ Third attempt, use gst_pad_is_linked() this time.
+
2006-02-04 Jan Schmidt <thaytan@mad.scientist.com>
* gst/id3demux/id3v2frames.c: (id3demux_id3v2_parse_frame),
if (stream->pad)
gst_object_unref (stream->pad);
pad = stream->pad = gst_pad_new_from_template (templ, padname);
+ stream->last_flow = GST_FLOW_OK;
g_free (padname);
gst_pad_use_fixed_caps (pad);
static gboolean
gst_avi_demux_all_source_pads_unlinked (GstAviDemux * avi)
{
- gint i, num_unlinked = 0;
+ gint i;
for (i = 0; i < avi->num_streams; ++i) {
- GstPad *peer;
-
- peer = gst_pad_get_peer (avi->stream[i].pad);
- if (peer) {
- gst_object_unref (peer);
- } else if (avi->stream[i].current_frame > 0) {
- ++num_unlinked;
- }
+ if (gst_pad_is_linked (avi->stream[i].pad))
+ return FALSE;
+ /* ignore unlinked state if we haven't tried to push on this pad yet */
+ if (avi->stream[i].last_flow == GST_FLOW_OK)
+ return FALSE;
}
- return (num_unlinked == avi->num_streams);
+ return TRUE;
}
static GstFlowReturn
GST_BUFFER_SIZE (buf), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
GST_PAD_NAME (stream->pad));
res = gst_pad_push (stream->pad, buf);
+ stream->last_flow = res;
if (res != GST_FLOW_OK && res != GST_FLOW_NOT_LINKED) {
GST_DEBUG_OBJECT (avi, "Flow on pad %s: %s",
GST_PAD_NAME (stream->pad), gst_flow_get_name (res));