Add timebase conversion call
authorMonty <xiphmont@xiph.org>
Mon, 23 Sep 2002 21:47:18 +0000 (21:47 +0000)
committerMonty <xiphmont@xiph.org>
Mon, 23 Sep 2002 21:47:18 +0000 (21:47 +0000)
svn path=/trunk/vorbis/; revision=3940

include/vorbis/codec.h
lib/info.c

index 117e7ef..ee47fdc 100644 (file)
@@ -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 ****************************/
 
index bb55f88..d00d0a9 100644 (file)
@@ -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);
+}