Commit 4b549001 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠
Browse files

gst/avi/gstavidemux.*: Third attempt, use gst_pad_is_linked() this time.

Original commit message from CVS:
* 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.
parent 4836bfbc
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),
......
......@@ -1052,6 +1052,7 @@ gst_avi_demux_parse_stream (GstElement * element, GstBuffer * buf)
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);
......@@ -2243,20 +2244,17 @@ gst_avi_demux_invert (avi_stream_context * stream, GstBuffer * buf)
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
......@@ -2314,6 +2312,7 @@ gst_avi_demux_process_next_entry (GstAviDemux * avi)
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));
......
......@@ -62,6 +62,7 @@ typedef struct {
/* pad, strh */
GstPad *pad;
GstFlowReturn last_flow;
gst_riff_strh *strh;
union {
gst_riff_strf_vids *vids;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment