From ec9141a08b19f4f84b162f4ae59d449f7b6eb8e4 Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 3 Apr 2000 09:45:55 +0000 Subject: Fixed a seeking bug; I shot myself int he foot by adding the expected_pageno arg to stream_reset; it needed the out of sequence trip to skip past continued packets. Removed the argument; stream_reset no sets pageno to -1 (not 0 like in init) so that seeks are flagged; the out of sequence handling trips, but the -1 surpresses the out of sequence error. Monty svn path=/trunk/vorbis/; revision=301 --- include/vorbis/codec.h | 4 ++-- lib/framing.c | 12 +++++++----- lib/res0.c | 10 ++++++---- lib/vorbisfile.c | 4 ++-- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/include/vorbis/codec.h b/include/vorbis/codec.h index ff5907e1..56a00f76 100644 --- a/include/vorbis/codec.h +++ b/include/vorbis/codec.h @@ -12,7 +12,7 @@ ******************************************************************** function: libvorbis codec headers - last mod: $Id: codec.h,v 1.10 2000/02/16 22:34:43 xiphmont Exp $ + last mod: $Id: codec.h,v 1.11 2000/04/03 09:45:55 xiphmont Exp $ ********************************************************************/ @@ -340,7 +340,7 @@ extern int ogg_stream_packetout(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,long expected_pageno); +extern int ogg_stream_reset(ogg_stream_state *os); extern int ogg_stream_destroy(ogg_stream_state *os); extern int ogg_stream_eof(ogg_stream_state *os); diff --git a/lib/framing.c b/lib/framing.c index b2ca7191..f79c63fc 100644 --- a/lib/framing.c +++ b/lib/framing.c @@ -13,7 +13,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.15 2000/03/10 13:21:18 xiphmont Exp $ + last mod: $Id: framing.c,v 1.16 2000/04/03 09:45:55 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 @@ -611,8 +611,10 @@ int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og){ os->lacing_fill=os->lacing_packet; /* make a note of dropped data in segment table */ - os->lacing_vals[os->lacing_fill++]=0x400; - os->lacing_packet++; + if(os->pageno!=-1){ + os->lacing_vals[os->lacing_fill++]=0x400; + os->lacing_packet++; + } /* are we a 'continued packet' page? If so, we'll need to skip some segments */ @@ -684,7 +686,7 @@ int ogg_sync_reset(ogg_sync_state *oy){ return(0); } -int ogg_stream_reset(ogg_stream_state *os,long expected_pageno){ +int ogg_stream_reset(ogg_stream_state *os){ os->body_fill=0; os->body_returned=0; @@ -696,7 +698,7 @@ int ogg_stream_reset(ogg_stream_state *os,long expected_pageno){ os->e_o_s=0; os->b_o_s=0; - os->pageno=expected_pageno; + os->pageno=-1; os->packetno=0; os->pcmpos=0; diff --git a/lib/res0.c b/lib/res0.c index f5c24c87..6c931255 100644 --- a/lib/res0.c +++ b/lib/res0.c @@ -12,7 +12,7 @@ ******************************************************************** function: residue backend 0 implementation - last mod: $Id: res0.c,v 1.8 2000/02/23 11:22:46 xiphmont Exp $ + last mod: $Id: res0.c,v 1.9 2000/04/03 09:45:55 xiphmont Exp $ ********************************************************************/ @@ -340,9 +340,11 @@ int inverse(vorbis_block *vb,vorbis_look_residue *vl,double **in,int ch){ for(i=info->begin,l=0;iend;){ /* fetch the partition word for each channel */ - for(j=0;jdecodemap[vorbis_book_decode(look->phrasebook, - &vb->opb)]; + for(j=0;jphrasebook,&vb->opb); + partword[j]=look->decodemap[temp]; + if(partword[j]==NULL)exit(1); + } /* now we decode interleaved residual values for the partitions */ for(k=0;kcurrent_link=link; ogg_stream_init(&vf->os,vf->current_serialno); - ogg_stream_reset(&vf->os,ogg_page_pageno(&og)); + ogg_stream_reset(&vf->os); }else{ /* we're streaming */ -- cgit v1.2.1