summaryrefslogtreecommitdiff
path: root/src/framing.c
diff options
context:
space:
mode:
authorMonty <xiphmont@xiph.org>2001-05-24 21:22:52 +0000
committerMonty <xiphmont@xiph.org>2001-05-24 21:22:52 +0000
commit4a0a325590b296b863e4fb34365837cfae341aa9 (patch)
treeca459a3c5a548181ac6b3d3407b7b0442f32b49c /src/framing.c
parentff3e7260a06ccd0eeb473b7e16c6efcfc48ab6ed (diff)
downloadogg-4a0a325590b296b863e4fb34365837cfae341aa9.tar.gz
optimization when using peek as a packet detector
git-svn-id: http://svn.xiph.org/trunk/ogg@1455 0101bb08-14d6-0310-b084-bc0e0c8e3800
Diffstat (limited to 'src/framing.c')
-rw-r--r--src/framing.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/framing.c b/src/framing.c
index 128c98e..e608b9f 100644
--- a/src/framing.c
+++ b/src/framing.c
@@ -12,7 +12,7 @@
function: code raw [Vorbis] packets into framed OggSquish stream and
decode Ogg streams back into raw packets
- last mod: $Id: framing.c,v 1.13 2001/05/24 05:17:14 xiphmont Exp $
+ last mod: $Id: framing.c,v 1.14 2001/05/24 21:22:52 xiphmont Exp $
note: The CRC code is directly derived from public domain code by
Ross Williams (ross@guest.adelaide.edu.au). See docs/framing.html
@@ -784,6 +784,10 @@ static int _packetout(ogg_stream_state *os,ogg_packet *op,int adv){
return(-1);
}
+ if(!op && !adv)return(1); /* just using peek as an inexpensive way
+ to ask if there's a whole packet
+ waiting */
+
/* Gather the whole packet. We'll have no holes or a partial packet */
{
int size=os->lacing_vals[ptr]&0xff;