mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
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.
This commit is contained in:
parent
ecaf089d0d
commit
7879080357
5 changed files with 50 additions and 12 deletions
24
ChangeLog
24
ChangeLog
|
@ -1,3 +1,27 @@
|
||||||
|
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>
|
2005-10-20 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_get_query_types),
|
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_get_query_types),
|
||||||
|
|
|
@ -70,7 +70,7 @@ struct _GstTheoraDec
|
||||||
gdouble segment_rate;
|
gdouble segment_rate;
|
||||||
gint64 segment_start;
|
gint64 segment_start;
|
||||||
gint64 segment_stop;
|
gint64 segment_stop;
|
||||||
gint64 segment_base;
|
gint64 segment_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstTheoraDecClass
|
struct _GstTheoraDecClass
|
||||||
|
@ -447,7 +447,7 @@ theora_dec_src_query (GstPad * pad, GstQuery * query)
|
||||||
granulepos, &my_format, &time)))
|
granulepos, &my_format, &time)))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
time = (time - dec->segment_start) + dec->segment_base;
|
time = (time - dec->segment_start) + dec->segment_time;
|
||||||
|
|
||||||
GST_LOG_OBJECT (dec,
|
GST_LOG_OBJECT (dec,
|
||||||
"query %p: our time: %" GST_TIME_FORMAT, query, GST_TIME_ARGS (time));
|
"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;
|
GstFormat format;
|
||||||
gdouble rate;
|
gdouble rate;
|
||||||
gint64 start, stop, base;
|
gint64 start, stop, time;
|
||||||
|
|
||||||
GST_STREAM_LOCK (pad);
|
GST_STREAM_LOCK (pad);
|
||||||
gst_event_parse_newsegment (event, NULL, &rate, &format, &start, &stop,
|
gst_event_parse_newsegment (event, NULL, &rate, &format, &start, &stop,
|
||||||
&base);
|
&time);
|
||||||
|
|
||||||
/* we need TIME and a positive rate */
|
/* we need TIME and a positive rate */
|
||||||
if (format != GST_FORMAT_TIME)
|
if (format != GST_FORMAT_TIME)
|
||||||
|
@ -626,7 +626,7 @@ theora_dec_sink_event (GstPad * pad, GstEvent * event)
|
||||||
dec->segment_rate = rate;
|
dec->segment_rate = rate;
|
||||||
dec->segment_start = start;
|
dec->segment_start = start;
|
||||||
dec->segment_stop = stop;
|
dec->segment_stop = stop;
|
||||||
dec->segment_base = base;
|
dec->segment_time = time;
|
||||||
|
|
||||||
dec->need_keyframe = TRUE;
|
dec->need_keyframe = TRUE;
|
||||||
dec->granulepos = -1;
|
dec->granulepos = -1;
|
||||||
|
|
|
@ -291,7 +291,7 @@ vorbis_dec_src_query (GstPad * pad, GstQuery * query)
|
||||||
&value)))
|
&value)))
|
||||||
goto error;
|
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);
|
gst_query_set_position (query, format, value);
|
||||||
|
|
||||||
|
@ -433,12 +433,12 @@ vorbis_dec_sink_event (GstPad * pad, GstEvent * event)
|
||||||
{
|
{
|
||||||
GstFormat format;
|
GstFormat format;
|
||||||
gdouble rate;
|
gdouble rate;
|
||||||
gint64 start, stop, base;
|
gint64 start, stop, time;
|
||||||
gboolean update;
|
gboolean update;
|
||||||
|
|
||||||
GST_STREAM_LOCK (pad);
|
GST_STREAM_LOCK (pad);
|
||||||
gst_event_parse_newsegment (event, &update, &rate, &format, &start, &stop,
|
gst_event_parse_newsegment (event, &update, &rate, &format, &start, &stop,
|
||||||
&base);
|
&time);
|
||||||
|
|
||||||
if (format != GST_FORMAT_TIME)
|
if (format != GST_FORMAT_TIME)
|
||||||
goto newseg_wrong_format;
|
goto newseg_wrong_format;
|
||||||
|
@ -450,7 +450,7 @@ vorbis_dec_sink_event (GstPad * pad, GstEvent * event)
|
||||||
dec->segment_rate = rate;
|
dec->segment_rate = rate;
|
||||||
dec->segment_start = start;
|
dec->segment_start = start;
|
||||||
dec->segment_stop = stop;
|
dec->segment_stop = stop;
|
||||||
dec->segment_base = base;
|
dec->segment_time = time;
|
||||||
|
|
||||||
dec->granulepos = -1;
|
dec->granulepos = -1;
|
||||||
dec->cur_timestamp = GST_CLOCK_TIME_NONE;
|
dec->cur_timestamp = GST_CLOCK_TIME_NONE;
|
||||||
|
|
|
@ -62,7 +62,7 @@ struct _GstVorbisDec {
|
||||||
gdouble segment_rate;
|
gdouble segment_rate;
|
||||||
gint64 segment_start;
|
gint64 segment_start;
|
||||||
gint64 segment_stop;
|
gint64 segment_stop;
|
||||||
gint64 segment_base;
|
gint64 segment_time;
|
||||||
|
|
||||||
GstClockTime cur_timestamp; /* only used with non-ogg container formats */
|
GstClockTime cur_timestamp; /* only used with non-ogg container formats */
|
||||||
GstClockTime prev_timestamp; /* only used with non-ogg container formats */
|
GstClockTime prev_timestamp; /* only used with non-ogg container formats */
|
||||||
|
|
|
@ -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_DEBUG ("time %" GST_TIME_FORMAT ", offset %llu, start %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (time), in_offset, GST_TIME_ARGS (bsink->segment_start));
|
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;
|
render_diff = time - bsink->segment_start;
|
||||||
|
|
||||||
/* samples should be rendered based on their timestamp. All samples
|
/* samples should be rendered based on their timestamp. All samples
|
||||||
* arriving before the segment_start are to be thrown away */
|
* arriving before the segment_start are to be thrown away */
|
||||||
/* FIXME, for now we drop the sample completely, we should
|
/* FIXME, for now we drop the sample completely, we should
|
||||||
* in fact clip the sample. Same for the segment_stop, actually. */
|
* in fact clip the sample. Same for the segment_stop, actually. */
|
||||||
if (render_diff < 0)
|
if (render_diff < 0)
|
||||||
return GST_FLOW_OK;
|
goto out_of_segment;
|
||||||
|
|
||||||
/* bring buffer timestamp to stream time */
|
/* bring buffer timestamp to stream time */
|
||||||
render_time = render_diff;
|
render_time = render_diff;
|
||||||
|
@ -415,6 +421,7 @@ gst_base_audio_sink_render (GstBaseSink * bsink, GstBuffer * buf)
|
||||||
GST_DEBUG ("resync");
|
GST_DEBUG ("resync");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
no_sync:
|
||||||
/* clip length based on rate */
|
/* clip length based on rate */
|
||||||
samples /= ABS (bsink->segment_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);
|
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_DEBUG ("start playback because we are at the end of segment");
|
||||||
gst_ring_buffer_start (ringbuf);
|
gst_ring_buffer_start (ringbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
return GST_FLOW_OK;
|
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:
|
wrong_state:
|
||||||
{
|
{
|
||||||
GST_DEBUG ("ringbuffer not negotiated");
|
GST_DEBUG ("ringbuffer not negotiated");
|
||||||
|
|
Loading…
Reference in a new issue