}
if (name == NULL || template == NULL || caps == NULL) {
- if (name)
- g_free (name);
+ g_free (name);
if (caps)
gst_caps_unref (caps);
return FALSE;
/* Set the buffer discont flag, and clear discont state on the stream */
if (stream->discont) {
- GST_DEBUG_OBJECT (demux, "marking discont buffer");
+ GST_DEBUG_OBJECT (demux, "discont buffer to pad %" GST_PTR_FORMAT
+ " with TS %" GST_TIME_FORMAT, stream->pad, GST_TIME_ARGS (timestamp));
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
stream->discont = FALSE;
g_snprintf (cur_stream_name, 32, "audio-%d-format", i);
if (!gst_structure_get_int (structure, cur_stream_name, &stream_format))
- break;
+ continue;
switch (stream_format) {
case 0x0:
}
break;
}
+ case GST_EVENT_CAPS:
+ gst_event_unref (event);
+ break;
default:
gst_flups_demux_send_event (demux, event);
break;
GstClockTime pos;
GstFormat format;
+ /* See if upstream can immediately answer */
+ res = gst_pad_peer_query (demux->sinkpad, query);
+ if (res)
+ break;
+
gst_query_parse_position (query, &format, NULL);
if (format != GST_FORMAT_TIME) {
pos = demux->src_segment.position - demux->src_segment.start;
GST_LOG_OBJECT (demux, "Position %" GST_TIME_FORMAT, GST_TIME_ARGS (pos));
+
gst_query_set_position (query, format, pos);
res = TRUE;
break;
{
GstFormat format;
gint64 duration;
- GstPad *peer;
GstQuery *byte_query;
gst_query_parse_duration (query, &format, NULL);
break;
}
- if ((peer = gst_pad_get_peer (demux->sinkpad)) == NULL) {
- GST_DEBUG_OBJECT (demux, "duration not possible, no peer");
- goto not_supported;
- }
-
/* For any format other than bytes, see if upstream knows first */
if (format == GST_FORMAT_BYTES) {
GST_DEBUG_OBJECT (demux, "duration not supported for format %d",
format);
- gst_object_unref (peer);
goto not_supported;
}
- if (gst_pad_query (peer, query)) {
- gst_object_unref (peer);
+ if (gst_pad_peer_query (demux->sinkpad, query)) {
res = TRUE;
break;
}
if (format != GST_FORMAT_TIME) {
GST_DEBUG_OBJECT (demux, "duration not supported for format %d",
format);
- gst_object_unref (peer);
goto not_supported;
}
if (demux->mux_rate == -1) {
GST_DEBUG_OBJECT (demux, "duration not possible, no mux_rate");
- gst_object_unref (peer);
goto not_supported;
}
byte_query = gst_query_new_duration (GST_FORMAT_BYTES);
- if (!gst_pad_query (peer, byte_query)) {
+ if (!gst_pad_peer_query (demux->sinkpad, byte_query)) {
GST_LOG_OBJECT (demux, "query on peer pad failed");
gst_query_unref (byte_query);
- gst_object_unref (peer);
goto not_supported;
}
- gst_object_unref (peer);
gst_query_parse_duration (byte_query, &format, &duration);
gst_query_unref (byte_query);
return gst_flups_demux_sink_activate_push (pad, parent, active);
} else if (mode == GST_PAD_MODE_PULL) {
return gst_flups_demux_sink_activate_pull (pad, parent, active);
- } else {
- return FALSE;
}
+ return FALSE;
}
static GstFlowReturn
* Fluendo, S.L. All Rights Reserved.
*
* Contributor(s): Wim Taymans <wim@fluendo.com>
+ * Jan Schmidt <thaytan@noraisin.net>
*/
#ifndef __GST_FLUPS_DEMUX_H__
#include "gstpesfilter.h"
G_BEGIN_DECLS
+
#define GST_TYPE_FLUPS_DEMUX (gst_flups_demux_get_type())
#define GST_FLUPS_DEMUX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FLUPS_DEMUX,GstFluPSDemux))
#define GST_FLUPS_DEMUX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FLUPS_DEMUX,GstFluPSDemuxClass))
#define GST_FLUPS_DEMUX_GET_CLASS(klass) (G_TYPE_INSTANCE_GET_CLASS((klass),GST_TYPE_FLUPS_DEMUX,GstFluPSDemuxClass))
#define GST_IS_FLUPS_DEMUX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FLUPS_DEMUX))
#define GST_IS_FLUPS_DEMUX_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FLUPS_DEMUX))
+
typedef struct _GstFluPSStream GstFluPSStream;
typedef struct _GstFluPSDemux GstFluPSDemux;
typedef struct _GstFluPSDemuxClass GstFluPSDemuxClass;