[xiph-commits] r3279 - liboggplay/trunk/src/liboggplay

shans at svn.annodex.net shans at svn.annodex.net
Sun Nov 25 19:58:56 PST 2007


Author: shans
Date: 2007-11-25 19:58:55 -0800 (Sun, 25 Nov 2007)
New Revision: 3279

Modified:
   liboggplay/trunk/src/liboggplay/oggplay.c
   liboggplay/trunk/src/liboggplay/oggplay_callback.c
   liboggplay/trunk/src/liboggplay/oggplay_private.h
Log:
Fix up some mixups in presentation time handling



Modified: liboggplay/trunk/src/liboggplay/oggplay.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay.c	2007-11-26 03:55:29 UTC (rev 3278)
+++ liboggplay/trunk/src/liboggplay/oggplay.c	2007-11-26 03:58:55 UTC (rev 3279)
@@ -192,7 +192,7 @@
   }
  
   me->callback_period = me->decode_data[track]->granuleperiod * frames;
-  me->target = (me->presentation_time * 1000) + me->callback_period - 1;
+  me->target = me->presentation_time + me->callback_period - 1;
 
   
   return E_OGGPLAY_OK;

Modified: liboggplay/trunk/src/liboggplay/oggplay_callback.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_callback.c	2007-11-26 03:55:29 UTC (rev 3278)
+++ liboggplay/trunk/src/liboggplay/oggplay_callback.c	2007-11-26 03:58:55 UTC (rev 3279)
@@ -46,14 +46,6 @@
 #include <time.h>
 #include <string.h>
 
-typedef struct {
-  void (*init)(void *user_data);
-  int (*callback)(OGGZ * oggz, ogg_packet * op, long serialno, 
-                                                          void * user_data);
-  void (*shutdown)(void *user_data);
-  int size;
-} OggPlayCallbackFunctions;
-
 void
 oggplay_init_theora(void *user_data) {
 
@@ -249,7 +241,7 @@
     bt_num = extract_int64(op->packet + 28);
     bt_den = extract_int64(op->packet + 36);
 
-    decoder->presentation_time = (pt_num << 32) / pt_den;
+    decoder->presentation_time = (pt_num << 32) * 1000 / pt_den;
     decoder->base_time = (bt_num << 32) / bt_den;
     
     /* initialise the presentation times in the player to the values recorded in the skeleton */
@@ -303,7 +295,8 @@
      */
     oggplay_data_handle_audio_data(&(decoder->decoder), (short *)pcm, frames, 
               sizeof(float));
-  }
+  } 
+
   return FISH_SOUND_CONTINUE;
 }
 
@@ -364,7 +357,7 @@
   return 0;
 }
 
-static OggPlayCallbackFunctions callbacks[] = {
+OggPlayCallbackFunctions callbacks[] = {
   {oggplay_init_theora, oggplay_callback_theora, oggplay_shutdown_theora, 
         sizeof(OggPlayTheoraDecode)},        /* THEORA */
   {oggplay_init_audio, oggplay_callback_audio, oggplay_shutdown_audio, 

Modified: liboggplay/trunk/src/liboggplay/oggplay_private.h
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_private.h	2007-11-26 03:55:29 UTC (rev 3278)
+++ liboggplay/trunk/src/liboggplay/oggplay_private.h	2007-11-26 03:58:55 UTC (rev 3279)
@@ -158,6 +158,7 @@
   int             uv_width;
   int             uv_height;
   int             uv_stride;
+  int             cached_keyframe;
 } OggPlayTheoraDecode;
 
 typedef struct {
@@ -211,6 +212,14 @@
 void
 oggplay_take_out_trash(OggPlay *me, OggPlaySeekTrash *trash);
 
+typedef struct {
+  void (*init)(void *user_data);
+  int (*callback)(OGGZ * oggz, ogg_packet * op, long serialno, 
+                                                          void * user_data);
+  void (*shutdown)(void *user_data);
+  int size;
+} OggPlayCallbackFunctions;
+
 #include "oggplay_callback.h"
 #include "oggplay_data.h"
 #include "oggplay_buffer.h"



More information about the commits mailing list