gst_cdda_base_src_update_duration (GstCddaBaseSrc * src)
{
GstBaseSrc *basesrc;
- GstFormat format;
- gint64 duration;
+ gint64 dur;
basesrc = GST_BASE_SRC (src);
- format = GST_FORMAT_TIME;
- if (!gst_pad_query_duration (GST_BASE_SRC_PAD (src), &format, &duration)) {
- duration = GST_CLOCK_TIME_NONE;
+ if (!gst_pad_query_duration (GST_BASE_SRC_PAD (src), GST_FORMAT_TIME, &dur)) {
+ dur = GST_CLOCK_TIME_NONE;
}
- basesrc->segment.duration = duration;
+ basesrc->segment.duration = dur;
gst_element_post_message (GST_ELEMENT (src),
gst_message_new_duration (GST_OBJECT (src), GST_FORMAT_TIME, -1));
GST_LOG_OBJECT (src, "duration updated to %" GST_TIME_FORMAT,
- GST_TIME_ARGS (duration));
+ GST_TIME_ARGS (dur));
}
#define CD_MSF_OFFSET 150
GstCddaBaseSrcClass *klass = GST_CDDA_BASE_SRC_GET_CLASS (pushsrc);
GstCddaBaseSrc *src = GST_CDDA_BASE_SRC (pushsrc);
GstBuffer *buf;
- GstFormat format;
gboolean eos;
GstClockTime position = GST_CLOCK_TIME_NONE;
return GST_FLOW_ERROR;
}
- format = GST_FORMAT_TIME;
- if (gst_pad_query_position (GST_BASE_SRC_PAD (src), &format, &qry_position)) {
+ if (gst_pad_query_position (GST_BASE_SRC_PAD (src), GST_FORMAT_TIME,
+ &qry_position)) {
gint64 next_ts = 0;
position = (GstClockTime) qry_position;
++src->cur_sector;
- if (gst_pad_query_position (GST_BASE_SRC_PAD (src), &format, &next_ts)) {
+ if (gst_pad_query_position (GST_BASE_SRC_PAD (src), GST_FORMAT_TIME,
+ &next_ts)) {
duration = (GstClockTime) (next_ts - qry_position);
}
--src->cur_sector;
/* FIXME : Make this querying optional */
if (TRUE) {
GstElement *pipeline = (GstElement *) dc->priv->pipeline;
- GstFormat format = GST_FORMAT_TIME;
gint64 dur;
GST_DEBUG ("Attempting to query duration");
- if (gst_element_query_duration (pipeline, &format, &dur)) {
- if (format == GST_FORMAT_TIME) {
- GST_DEBUG ("Got duration %" GST_TIME_FORMAT, GST_TIME_ARGS (dur));
- dc->priv->current_info->duration = (guint64) dur;
- }
+ if (gst_element_query_duration (pipeline, GST_FORMAT_TIME, &dur)) {
+ GST_DEBUG ("Got duration %" GST_TIME_FORMAT, GST_TIME_ARGS (dur));
+ dc->priv->current_info->duration = (guint64) dur;
}
if (dc->priv->seeking_query) {
if (gst_element_query (pipeline, dc->priv->seeking_query)) {
+ GstFormat format;
gboolean seekable;
gst_query_parse_seeking (dc->priv->seeking_query, &format,
static gboolean
gst_tag_demux_get_upstream_size (GstTagDemux * tagdemux)
{
- GstFormat format;
gint64 len;
/* Short-cut if we already queried upstream */
if (tagdemux->priv->upstream_size > 0)
return TRUE;
- format = GST_FORMAT_BYTES;
- if (!gst_pad_query_peer_duration (tagdemux->priv->sinkpad, &format, &len) ||
- len <= 0) {
+ if (!gst_pad_query_peer_duration (tagdemux->priv->sinkpad, GST_FORMAT_BYTES,
+ &len) || len <= 0) {
return FALSE;
}