+2005-10-21 Wim Taymans <wim@fluendo.com>
+
+ * ext/theora/theoradec.c: (theora_dec_src_query),
+ (theora_dec_sink_event):
+ * ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
+ (vorbis_dec_sink_event), (vorbis_handle_identification_packet),
+ (vorbis_handle_data_packet):
+ * ext/vorbis/vorbisdec.h:
+ Fix old naming.
+
+ * gst-libs/gst/audio/gstbaseaudiosink.c:
+ (gst_base_audio_sink_render):
+ Don't try to sync on buffers without a timestamp.
+
+2005-10-21 Wim Taymans <wim@fluendo.com>
+
+ * ext/theora/theoradec.c: (theora_dec_src_query),
+ (theora_dec_sink_event):
+ * ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
+ (vorbis_dec_sink_event), (vorbis_handle_identification_packet),
+ (vorbis_handle_data_packet):
+ * ext/vorbis/vorbisdec.h:
+ Fix old naming.
+
2005-10-20 Tim-Philipp Müller <tim at centricular dot net>
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_get_query_types),
gdouble segment_rate;
gint64 segment_start;
gint64 segment_stop;
- gint64 segment_base;
+ gint64 segment_time;
};
struct _GstTheoraDecClass
granulepos, &my_format, &time)))
goto error;
- time = (time - dec->segment_start) + dec->segment_base;
+ time = (time - dec->segment_start) + dec->segment_time;
GST_LOG_OBJECT (dec,
"query %p: our time: %" GST_TIME_FORMAT, query, GST_TIME_ARGS (time));
{
GstFormat format;
gdouble rate;
- gint64 start, stop, base;
+ gint64 start, stop, time;
GST_STREAM_LOCK (pad);
gst_event_parse_newsegment (event, NULL, &rate, &format, &start, &stop,
- &base);
+ &time);
/* we need TIME and a positive rate */
if (format != GST_FORMAT_TIME)
dec->segment_rate = rate;
dec->segment_start = start;
dec->segment_stop = stop;
- dec->segment_base = base;
+ dec->segment_time = time;
dec->need_keyframe = TRUE;
dec->granulepos = -1;
&value)))
goto error;
- value = (value - dec->segment_start) + dec->segment_base;
+ value = (value - dec->segment_start) + dec->segment_time;
gst_query_set_position (query, format, value);
{
GstFormat format;
gdouble rate;
- gint64 start, stop, base;
+ gint64 start, stop, time;
gboolean update;
GST_STREAM_LOCK (pad);
gst_event_parse_newsegment (event, &update, &rate, &format, &start, &stop,
- &base);
+ &time);
if (format != GST_FORMAT_TIME)
goto newseg_wrong_format;
dec->segment_rate = rate;
dec->segment_start = start;
dec->segment_stop = stop;
- dec->segment_base = base;
+ dec->segment_time = time;
dec->granulepos = -1;
dec->cur_timestamp = GST_CLOCK_TIME_NONE;
gdouble segment_rate;
gint64 segment_start;
gint64 segment_stop;
- gint64 segment_base;
+ gint64 segment_time;
GstClockTime cur_timestamp; /* only used with non-ogg container formats */
GstClockTime prev_timestamp; /* only used with non-ogg container formats */
GST_DEBUG ("time %" GST_TIME_FORMAT ", offset %llu, start %" GST_TIME_FORMAT,
GST_TIME_ARGS (time), in_offset, GST_TIME_ARGS (bsink->segment_start));
+ if (!GST_CLOCK_TIME_IS_VALID (time)) {
+ render_offset = sink->next_sample;
+ goto no_sync;
+ }
+
render_diff = time - bsink->segment_start;
+
/* samples should be rendered based on their timestamp. All samples
* arriving before the segment_start are to be thrown away */
/* FIXME, for now we drop the sample completely, we should
* in fact clip the sample. Same for the segment_stop, actually. */
if (render_diff < 0)
- return GST_FLOW_OK;
+ goto out_of_segment;
/* bring buffer timestamp to stream time */
render_time = render_diff;
GST_DEBUG ("resync");
}
+no_sync:
/* clip length based on rate */
samples /= ABS (bsink->segment_rate);
gst_ring_buffer_commit (ringbuf, render_offset, data, samples);
- if (time + duration >= bsink->segment_stop) {
+ if (GST_CLOCK_TIME_IS_VALID (time) && time + duration >= bsink->segment_stop) {
GST_DEBUG ("start playback because we are at the end of segment");
gst_ring_buffer_start (ringbuf);
}
return GST_FLOW_OK;
+out_of_segment:
+ {
+ GST_DEBUG ("dropping sample out of segment time %" GST_TIME_FORMAT
+ ", start %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (time), GST_TIME_ARGS (bsink->segment_start));
+ return GST_FLOW_OK;
+ }
wrong_state:
{
GST_DEBUG ("ringbuffer not negotiated");