2007-05-21 Wim Taymans <wim@fluendo.com>
+ * ext/cdparanoia/gstcdparanoiasrc.c:
+ (gst_cd_paranoia_src_read_sector):
+ * gst-libs/gst/audio/gstbaseaudiosrc.c:
+ (gst_base_audio_src_create):
+ Small cleanups.
+
+ * ext/theora/theoradec.c: (theora_dec_sink_event):
+ Fix typo.
+
+ * gst-libs/gst/rtp/gstbasertpdepayload.c:
+ (gst_base_rtp_depayload_set_gst_timestamp):
+ Add some FIXME
+
+ * gst/playback/gstdecodebin.c: (queue_underrun_cb):
+ And some debug info when a FIXME path is hit.
+
+2007-05-21 Wim Taymans <wim@fluendo.com>
+
* gst-libs/gst/rtp/gstbasertpaudiopayload.c:
(gst_base_rtp_audio_payload_class_init),
(gst_base_rtp_audio_payload_init),
#endif
if (src->next_sector == -1 || src->next_sector != sector) {
- if (paranoia_seek (src->p, sector, SEEK_SET) == -1) {
- GST_WARNING_OBJECT (src, "seek to sector %d failed!", sector);
- GST_ELEMENT_ERROR (src, RESOURCE, SEEK,
- (_("Could not seek CD.")),
- ("paranoia_seek to %d failed: %s", sector, g_strerror (errno)));
- return NULL;
- }
+ if (paranoia_seek (src->p, sector, SEEK_SET) == -1)
+ goto seek_failed;
+
GST_DEBUG_OBJECT (src, "successfully seeked to sector %d", sector);
src->next_sector = sector;
}
cdda_buf = paranoia_read (src->p, gst_cd_paranoia_dummy_callback);
}
- if (cdda_buf == NULL) {
- GST_WARNING_OBJECT (src, "read at sector %d failed!", sector);
- GST_ELEMENT_ERROR (src, RESOURCE, READ,
- (_("Could not read CD.")),
- ("paranoia_read at %d failed: %s", sector, g_strerror (errno)));
- return NULL;
- }
+ if (cdda_buf == NULL)
+ goto read_failed;
buf = gst_buffer_new_and_alloc (CD_FRAMESIZE_RAW);
memcpy (GST_BUFFER_DATA (buf), cdda_buf, CD_FRAMESIZE_RAW);
++src->next_sector;
return buf;
+
+ /* ERRORS */
+seek_failed:
+ {
+ GST_WARNING_OBJECT (src, "seek to sector %d failed!", sector);
+ GST_ELEMENT_ERROR (src, RESOURCE, SEEK,
+ (_("Could not seek CD.")),
+ ("paranoia_seek to %d failed: %s", sector, g_strerror (errno)));
+ return NULL;
+ }
+read_failed:
+ {
+ GST_WARNING_OBJECT (src, "read at sector %d failed!", sector);
+ GST_ELEMENT_ERROR (src, RESOURCE, READ,
+ (_("Could not read CD.")),
+ ("paranoia_read at %d failed: %s", sector, g_strerror (errno)));
+ return NULL;
+ }
}
static void
gst_segment_set_newsegment_full (&dec->segment, update,
rate, arate, format, start, stop, time);
- /* iWe don't forward this unless/until the decoder is initialised */
+ /* We don't forward this unless/until the decoder is initialised */
if (dec->have_header) {
ret = gst_pad_push_event (dec->srcpad, event);
dec->sent_newsegment = TRUE;
gint bps;
GstRingBuffer *ringbuffer;
guint read;
+ GstClockTime timestamp;
ringbuffer = src->ringbuffer;
sample = gst_base_audio_src_get_offset (src);
}
+ GST_DEBUG_OBJECT (src, "reading from sample %" G_GUINT64_FORMAT, sample);
+
/* get the number of samples to read */
samples = length / bps;
* where we are slaved to another clock. We currently refuse to accept
* any other clock than the one we provide, so this code is fine for
* now. */
- GST_BUFFER_TIMESTAMP (buf) = gst_util_uint64_scale_int (sample,
- GST_SECOND, ringbuffer->spec.rate);
+ timestamp =
+ gst_util_uint64_scale_int (sample, GST_SECOND, ringbuffer->spec.rate);
+
+ GST_BUFFER_TIMESTAMP (buf) = timestamp;
src->next_sample = sample + samples;
GST_BUFFER_DURATION (buf) = gst_util_uint64_scale_int (src->next_sample,
GST_SECOND, ringbuffer->spec.rate) - GST_BUFFER_TIMESTAMP (buf);
if (priv->clock_base == -1)
priv->clock_base = timestamp;
+ /* FIXME, timestamp wraparound */
+
/* rtp timestamps are based on the clock_rate
* gst timesamps are in nanoseconds */
ts = gst_util_uint64_scale_int (timestamp, GST_SECOND, filter->clock_rate);
* list) and the overrun signals that are signalled from the
* demuxer thread.
*/
+ GST_DEBUG_OBJECT (decode_bin, "got underrun");
}
/* Make sure we don't have a full queue and empty queue situation */