From: Wim Taymans Date: Fri, 21 Oct 2005 15:14:36 +0000 (+0000) Subject: ext/: Fix old naming. X-Git-Tag: RELEASE-0_9_4~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=787908035790752c6693bd6ff2f2296cc954cb2f;p=platform%2Fupstream%2Fgst-plugins-base.git ext/: Fix old naming. Original commit message from CVS: * 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. --- diff --git a/ChangeLog b/ChangeLog index 6ce2390..67753ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2005-10-21 Wim Taymans + + * 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 + + * 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 * ext/vorbis/vorbisenc.c: (gst_vorbisenc_get_query_types), diff --git a/ext/theora/theoradec.c b/ext/theora/theoradec.c index 91c317c..46532fb 100644 --- a/ext/theora/theoradec.c +++ b/ext/theora/theoradec.c @@ -70,7 +70,7 @@ struct _GstTheoraDec gdouble segment_rate; gint64 segment_start; gint64 segment_stop; - gint64 segment_base; + gint64 segment_time; }; struct _GstTheoraDecClass @@ -447,7 +447,7 @@ theora_dec_src_query (GstPad * pad, GstQuery * query) 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)); @@ -609,11 +609,11 @@ theora_dec_sink_event (GstPad * pad, GstEvent * event) { 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) @@ -626,7 +626,7 @@ theora_dec_sink_event (GstPad * pad, GstEvent * event) 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; diff --git a/ext/vorbis/vorbisdec.c b/ext/vorbis/vorbisdec.c index d4e2e19..73c0ecb 100644 --- a/ext/vorbis/vorbisdec.c +++ b/ext/vorbis/vorbisdec.c @@ -291,7 +291,7 @@ vorbis_dec_src_query (GstPad * pad, GstQuery * query) &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); @@ -433,12 +433,12 @@ vorbis_dec_sink_event (GstPad * pad, GstEvent * event) { 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; @@ -450,7 +450,7 @@ vorbis_dec_sink_event (GstPad * pad, GstEvent * event) 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; diff --git a/ext/vorbis/vorbisdec.h b/ext/vorbis/vorbisdec.h index 4c01366..5ec19f1 100644 --- a/ext/vorbis/vorbisdec.h +++ b/ext/vorbis/vorbisdec.h @@ -62,7 +62,7 @@ struct _GstVorbisDec { 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 */ diff --git a/gst-libs/gst/audio/gstbaseaudiosink.c b/gst-libs/gst/audio/gstbaseaudiosink.c index 69ecda2..2aaa1a1 100644 --- a/gst-libs/gst/audio/gstbaseaudiosink.c +++ b/gst-libs/gst/audio/gstbaseaudiosink.c @@ -374,13 +374,19 @@ gst_base_audio_sink_render (GstBaseSink * bsink, GstBuffer * buf) 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; @@ -415,6 +421,7 @@ gst_base_audio_sink_render (GstBaseSink * bsink, GstBuffer * buf) GST_DEBUG ("resync"); } +no_sync: /* clip length based on rate */ samples /= ABS (bsink->segment_rate); @@ -423,13 +430,20 @@ gst_base_audio_sink_render (GstBaseSink * bsink, GstBuffer * buf) 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");