Commit ec9141a0 authored by Monty's avatar Monty
Browse files

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
parent 94b6b160
......@@ -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);
......
......@@ -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;
......
......@@ -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;i<info->end;){
/* fetch the partition word for each channel */
for(j=0;j<ch;j++)
partword[j]=look->decodemap[vorbis_book_decode(look->phrasebook,
&vb->opb)];
for(j=0;j<ch;j++){
int temp=vorbis_book_decode(look->phrasebook,&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;k<partitions_per_word;k++,l++,i+=samples_per_partition)
......
......@@ -12,7 +12,7 @@
********************************************************************
function: stdio-based convenience library for opening/seeking/decoding
last mod: $Id: vorbisfile.c,v 1.18 2000/04/03 08:30:49 xiphmont Exp $
last mod: $Id: vorbisfile.c,v 1.19 2000/04/03 09:45:55 xiphmont Exp $
********************************************************************/
......@@ -486,7 +486,7 @@ static int _process_packet(OggVorbis_File *vf,int readp){
vf->current_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 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment