diff options
author | Monty <xiphmont@xiph.org> | 2002-03-07 03:36:53 +0000 |
---|---|---|
committer | Monty <xiphmont@xiph.org> | 2002-03-07 03:36:53 +0000 |
commit | 01960469f335203fb2fa92a1d4eb3ba11394fd58 (patch) | |
tree | 75f0eb8d0d4e5e566a3472f45a713b32cef36ca3 | |
parent | 18a20fb26c69b19087f6b2303b4ab5c598f5c192 (diff) | |
download | ogg-git-01960469f335203fb2fa92a1d4eb3ba11394fd58.tar.gz |
add 'ogg_stream_reset_serialno()' because it's useful. The same
functionality before required a clear/init cycle that involved
free()/malloc().
Monty
svn path=/trunk/ogg/; revision=3125
-rw-r--r-- | include/ogg/ogg.h | 3 | ||||
-rw-r--r-- | src/framing.c | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/include/ogg/ogg.h b/include/ogg/ogg.h index 30ffa9c..41ad86a 100644 --- a/include/ogg/ogg.h +++ b/include/ogg/ogg.h @@ -11,7 +11,7 @@ ******************************************************************** function: toplevel libogg include - last mod: $Id: ogg.h,v 1.13 2001/12/20 00:58:44 segher Exp $ + last mod: $Id: ogg.h,v 1.14 2002/03/07 03:36:52 xiphmont Exp $ ********************************************************************/ #ifndef _OGG_H @@ -152,6 +152,7 @@ extern int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op); extern int ogg_stream_init(ogg_stream_state *os,int serialno); extern int ogg_stream_clear(ogg_stream_state *os); extern int ogg_stream_reset(ogg_stream_state *os); +extern int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno); extern int ogg_stream_destroy(ogg_stream_state *os); extern int ogg_stream_eos(ogg_stream_state *os); diff --git a/src/framing.c b/src/framing.c index 31e91c7..c025300 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.20 2001/12/20 00:58:45 segher Exp $ + last mod: $Id: framing.c,v 1.21 2002/03/07 03:36:53 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 @@ -822,6 +822,12 @@ int ogg_stream_reset(ogg_stream_state *os){ return(0); } +int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno){ + ogg_stream_reset(os); + os->serialno=serialno; + return(0); +} + static int _packetout(ogg_stream_state *os,ogg_packet *op,int adv){ /* The last part of decode. We have the stream broken into packet |