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

shans at svn.annodex.net shans at svn.annodex.net
Tue Jul 10 23:37:33 PDT 2007


Author: shans
Date: 2007-07-10 23:37:33 -0700 (Tue, 10 Jul 2007)
New Revision: 3159

Modified:
   liboggplay/trunk/src/liboggplay/oggplay.c
   liboggplay/trunk/src/liboggplay/oggplay_buffer.c
   liboggplay/trunk/src/liboggplay/oggplay_buffer.h
   liboggplay/trunk/src/liboggplay/oggplay_callback_info.c
Log:
Set LAST_DATA flag even in the absence of e_o_s packets (work around annodex 
URLs of type ?t=10.0/20.0 not providing e_o_s)



Modified: liboggplay/trunk/src/liboggplay/oggplay.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay.c	2007-07-10 06:47:18 UTC (rev 3158)
+++ liboggplay/trunk/src/liboggplay/oggplay.c	2007-07-11 06:37:33 UTC (rev 3159)
@@ -451,10 +451,26 @@
     /* end-of-file */
     if (r == 0) {
       num_records = oggplay_callback_info_prepare(me, &info);
+     /*
+       * set all of the tracks to active
+       */
+      for (i = 0; i < me->num_tracks; i++) {
+        me->decode_data[i]->active = 0;
+        me->active_tracks = 0;
+      }
+
       if (info != NULL) {
         me->callback (me, num_records, info, me->callback_user_ptr); 
         oggplay_callback_info_destroy(me, info);
       }
+      
+      /*
+       * ensure all tracks have their final data packet set to end_of_stream
+       */
+      if (me->buffer != NULL) {
+        oggplay_buffer_set_last_data(me, me->buffer);
+      }
+
       return E_OGGPLAY_OK;
     }
 

Modified: liboggplay/trunk/src/liboggplay/oggplay_buffer.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_buffer.c	2007-07-10 06:47:18 UTC (rev 3158)
+++ liboggplay/trunk/src/liboggplay/oggplay_buffer.c	2007-07-11 06:37:33 UTC (rev 3159)
@@ -113,6 +113,20 @@
 
 }
 
+void
+oggplay_buffer_set_last_data(OggPlay *me, volatile OggPlayBuffer *buffer) 
+{
+
+  int                   i;
+  OggPlayCallbackInfo * p = 
+            (OggPlayCallbackInfo *)buffer->buffer_list[buffer->last_filled];
+
+  for (i = 0; i < me->num_tracks; i++) {
+    p->stream_info = OGGPLAY_STREAM_LAST_DATA;
+    p++;
+  }
+}
+
 int
 oggplay_buffer_callback(OggPlay *me, int tracks, 
                  OggPlayCallbackInfo **track_info, void *user) {

Modified: liboggplay/trunk/src/liboggplay/oggplay_buffer.h
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_buffer.h	2007-07-10 06:47:18 UTC (rev 3158)
+++ liboggplay/trunk/src/liboggplay/oggplay_buffer.h	2007-07-11 06:37:33 UTC (rev 3159)
@@ -50,4 +50,8 @@
 
 void
 oggplay_buffer_prepare(OggPlay *me);
+
+void
+oggplay_buffer_set_last_data(OggPlay *me, volatile OggPlayBuffer *buffer);
+
 #endif

Modified: liboggplay/trunk/src/liboggplay/oggplay_callback_info.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_callback_info.c	2007-07-10 06:47:18 UTC (rev 3158)
+++ liboggplay/trunk/src/liboggplay/oggplay_callback_info.c	2007-07-11 06:37:33 UTC (rev 3159)
@@ -51,6 +51,7 @@
   int         added_required_record   = 1;
   ogg_int64_t diff;
   ogg_int64_t latest_first_record     = 0x0LL;
+  //ogg_int64_t lpt = 0;
  
   /*
    * allocate the structure for return to the user
@@ -125,13 +126,12 @@
     track_info->data_type = track->decoded_type;
  
     count = 0;
-    //ogg_int64_t lpt = 0;
     for (p = q; p != NULL; p = p->next) {
       track_info->records[count++] = p;
       if (p->presentation_time <= me->target + track->offset) {
         track_info->required_records++;
         p->has_been_presented = 1;
-        //lpt = p->presentation_time;
+        lpt = p->presentation_time;
       }
     }
 
@@ -153,9 +153,10 @@
  
     }
 
-    //printf("%d: %d/%d\t", i, 
-    //                track_info->required_records, count);
     /*
+    printf("%d: %d/%d\t", i, 
+                    track_info->required_records, count);
+    
     if (q != NULL) {
       printf("fst: %lld lst: %lld sz: %lld pt: %lld\n", 
                       q->presentation_time >> 32, lpt >> 32, 



More information about the commits mailing list