changeset 17785:adc0e54034f0

in demux_ogg_read_packet initialize data to whole packet, reduces code and fixes missing initialization in else + header packet case.
author reimar
date Wed, 08 Mar 2006 22:23:21 +0000
parents 1b42df5780e3
children f0f54034c7e9
files libmpdemux/demux_ogg.c
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ogg.c	Wed Mar 08 21:13:16 2006 +0000
+++ b/libmpdemux/demux_ogg.c	Wed Mar 08 22:23:21 2006 +0000
@@ -330,13 +330,12 @@
 }
 
 static unsigned char* demux_ogg_read_packet(ogg_stream_t* os,ogg_packet* pack,void *context,float* pts,int* flags, int samplesize) {
-  unsigned char* data;
+  unsigned char* data = pack->packet;
 
   *pts = 0;
   *flags = 0;
 
   if(os->vorbis) {
-    data = pack->packet;
     if(*pack->packet & PACKET_TYPE_HEADER)
       os->hdr_packets++;
     else if (context )
@@ -356,11 +355,10 @@
        os->lastpos = pack->granulepos;
     }
   } else if (os->speex) {
-    data = pack->packet;
+    // whole packet (default)
 # ifdef HAVE_OGGTHEORA
   } else if (os->theora) {
      /* we pass complete packets to theora, mustn't strip the header! */
-     data = pack->packet;
      os->lastsize = 1;
      
      /* header packets beginn on 1-bit: thus check (*data&0x80).  We don't
@@ -389,7 +387,6 @@
 # ifdef HAVE_FLAC
   } else if (os->flac) {
      /* we pass complete packets to flac, mustn't strip the header! */
-     data = pack->packet;
 #endif /* HAVE_FLAC */
   } else {
     if(*pack->packet & PACKET_TYPE_HEADER)