From 9ee314648e68bf61a758e164a4042428146369da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 27 Apr 2007 18:39:21 +0000 Subject: [PATCH] gst/asfdemux/gstasfdemux.c: Fix silly bug when we can't pull as much data as we want; don't forget to announce pendin... Original commit message from CVS: * gst/asfdemux/gstasfdemux.c: (gst_asf_demux_pull_data), (gst_asf_demux_push_complete_payloads), (gst_asf_demux_loop): Fix silly bug when we can't pull as much data as we want; don't forget to announce pending tags in the new packet parsing code. --- ChangeLog | 7 +++++++ gst/asfdemux/gstasfdemux.c | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0a6f6b8083..5475220d28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-04-27 Tim-Philipp Müller + + * gst/asfdemux/gstasfdemux.c: (gst_asf_demux_pull_data), + (gst_asf_demux_push_complete_payloads), (gst_asf_demux_loop): + Fix silly bug when we can't pull as much data as we want; don't + forget to announce pending tags in the new packet parsing code. + 2007-04-25 Tim-Philipp Müller * configure.ac: diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c index d37e6e6a5d..7740f1e115 100644 --- a/gst/asfdemux/gstasfdemux.c +++ b/gst/asfdemux/gstasfdemux.c @@ -749,7 +749,7 @@ gst_asf_demux_pull_data (GstASFDemux * demux, guint64 offset, guint size, GST_DEBUG_OBJECT (demux, "short read pulling buffer at %" G_GUINT64_FORMAT "+%u (got only %u bytes)", offset, size, GST_BUFFER_SIZE (*p_buf)); gst_buffer_unref (*p_buf); - if (*p_flow) + if (p_flow) *p_flow = GST_FLOW_UNEXPECTED; *p_buf = NULL; return FALSE; @@ -940,6 +940,14 @@ gst_asf_demux_push_complete_payloads (GstASFDemux * demux) if (!gst_asf_payload_is_complete (payload)) break; + /* Do we have tags pending for this stream? */ + if (stream->pending_tags) { + GST_LOG_OBJECT (stream->pad, "%" GST_PTR_FORMAT, stream->pending_tags); + gst_element_found_tags_for_pad (GST_ELEMENT (demux), stream->pad, + stream->pending_tags); + stream->pending_tags = NULL; + } + /* We have the whole packet now so we should push the packet to * the src pad now. First though we should check if we need to do * descrambling */ @@ -1093,6 +1101,7 @@ read_failed: { /* upstream should already have posted an error */ GST_ELEMENT_ERROR (demux, STREAM, DEMUX, (NULL), ("pull_range failed")); + gst_asf_demux_send_event_unlocked (demux, gst_event_new_eos ()); goto pause; } }