From 8b74d078b1b631f57d53e55fc3b3e4185fb14529 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Wed, 12 May 2004 07:18:03 +0000 Subject: [PATCH] copy this function until we really need > 1.0 of vorbis Original commit message from CVS: copy this function until we really need > 1.0 of vorbis --- ChangeLog | 7 +++++++ ext/vorbis/vorbisenc.c | 16 +++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index dd08913056..4cb79938e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-05-12 Thomas Vander Stichele + + * ext/vorbis/vorbisenc.c: (vorbis_granule_time_copy), + (gst_vorbisenc_push_packet): + copy a function that was added between 1.0 and 1.0.1 until we + depend on worthwhile features of post-1.0 + 2004-05-12 Benjamin Otte * configure.ac: diff --git a/ext/vorbis/vorbisenc.c b/ext/vorbis/vorbisenc.c index 5239f69759..a09b2b8475 100644 --- a/ext/vorbis/vorbisenc.c +++ b/ext/vorbis/vorbisenc.c @@ -58,6 +58,19 @@ enum ARG_LAST_MESSAGE, }; +/* FIXME: + * vorbis_granule_time was added between 1.0 and 1.0.1; it's too silly + * to require a new version for such a simple function, but once we move + * beyond 1.0 for other reasons we can remove this copy */ + +static double +vorbis_granule_time_copy (vorbis_dsp_state * v, ogg_int64_t granulepos) +{ + if (granulepos >= 0) + return ((double) granulepos / v->vi->rate); + return (-1); +} + static const GstFormat * gst_vorbisenc_get_formats (GstPad * pad) { @@ -683,7 +696,8 @@ gst_vorbisenc_push_packet (VorbisEnc * vorbisenc, ogg_packet * packet) GST_BUFFER_OFFSET (outbuf) = vorbisenc->bytes_out; GST_BUFFER_OFFSET_END (outbuf) = packet->granulepos; GST_BUFFER_TIMESTAMP (outbuf) = - vorbis_granule_time (&vorbisenc->vd, packet->granulepos) * GST_SECOND; + vorbis_granule_time_copy (&vorbisenc->vd, + packet->granulepos) * GST_SECOND; GST_DEBUG ("vorbisenc: encoded buffer of %d bytes", GST_BUFFER_SIZE (outbuf));