From a88ea667d99d92b9cac675cb1e08cb6a5f4e9512 Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 24 May 2001 21:22:52 +0000 Subject: optimization when using peek as a packet detector svn path=/trunk/ogg/; revision=1455 --- src/framing.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/framing.c') 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; -- cgit v1.2.1