From: Monty Date: Mon, 23 Sep 2002 21:47:18 +0000 (+0000) Subject: Add timebase conversion call X-Git-Tag: v1.3.3~667 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=410b6b025a9d1904f0d5cbd6fe62bec2af91a0c5;p=platform%2Fupstream%2Flibvorbis.git Add timebase conversion call svn path=/trunk/vorbis/; revision=3940 --- diff --git a/include/vorbis/codec.h b/include/vorbis/codec.h index 117e7ef..ee47fdc 100644 --- a/include/vorbis/codec.h +++ b/include/vorbis/codec.h @@ -11,7 +11,7 @@ ******************************************************************** function: libvorbis codec headers - last mod: $Id: codec.h,v 1.40 2002/02/28 04:12:47 xiphmont Exp $ + last mod: $Id: codec.h,v 1.41 2002/09/23 21:47:18 xiphmont Exp $ ********************************************************************/ @@ -176,6 +176,8 @@ extern void vorbis_comment_clear(vorbis_comment *vc); extern int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb); extern int vorbis_block_clear(vorbis_block *vb); extern void vorbis_dsp_clear(vorbis_dsp_state *v); +extern double vorbis_granule_time(vorbis_dsp_state *v, + ogg_int64_t granulepos); /* Vorbis PRIMITIVES: analysis/DSP layer ****************************/ diff --git a/lib/info.c b/lib/info.c index bb55f88..d00d0a9 100644 --- a/lib/info.c +++ b/lib/info.c @@ -11,7 +11,7 @@ ******************************************************************** function: maintain the info structure, info <-> header packets - last mod: $Id: info.c,v 1.59 2002/07/18 01:43:09 xiphmont Exp $ + last mod: $Id: info.c,v 1.60 2002/09/23 21:46:59 xiphmont Exp $ ********************************************************************/ @@ -596,3 +596,8 @@ int vorbis_analysis_headerout(vorbis_dsp_state *v, return(ret); } +double vorbis_granule_time(vorbis_dsp_state *v,ogg_int64_t granulepos){ + if(granulepos>=0) + return((double)granulepos/v->vi->rate); + return(-1); +}