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 @@ ...@@ -12,7 +12,7 @@
******************************************************************** ********************************************************************
function: libvorbis codec headers 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); ...@@ -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_init(ogg_stream_state *os,int serialno);
extern int ogg_stream_clear(ogg_stream_state *os); 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_destroy(ogg_stream_state *os);
extern int ogg_stream_eof(ogg_stream_state *os); extern int ogg_stream_eof(ogg_stream_state *os);
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
function: code raw [Vorbis] packets into framed OggSquish stream and function: code raw [Vorbis] packets into framed OggSquish stream and
decode Ogg streams back into raw packets 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 note: The CRC code is directly derived from public domain code by
Ross Williams (ross@guest.adelaide.edu.au). See docs/framing.html 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){ ...@@ -611,8 +611,10 @@ int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og){
os->lacing_fill=os->lacing_packet; os->lacing_fill=os->lacing_packet;
/* make a note of dropped data in segment table */ /* make a note of dropped data in segment table */
os->lacing_vals[os->lacing_fill++]=0x400; if(os->pageno!=-1){
os->lacing_packet++; os->lacing_vals[os->lacing_fill++]=0x400;
os->lacing_packet++;
}
/* are we a 'continued packet' page? If so, we'll need to skip /* are we a 'continued packet' page? If so, we'll need to skip
some segments */ some segments */
...@@ -684,7 +686,7 @@ int ogg_sync_reset(ogg_sync_state *oy){ ...@@ -684,7 +686,7 @@ int ogg_sync_reset(ogg_sync_state *oy){
return(0); 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_fill=0;
os->body_returned=0; os->body_returned=0;
...@@ -696,7 +698,7 @@ int ogg_stream_reset(ogg_stream_state *os,long expected_pageno){ ...@@ -696,7 +698,7 @@ int ogg_stream_reset(ogg_stream_state *os,long expected_pageno){
os->e_o_s=0; os->e_o_s=0;
os->b_o_s=0; os->b_o_s=0;
os->pageno=expected_pageno; os->pageno=-1;
os->packetno=0; os->packetno=0;
os->pcmpos=0; os->pcmpos=0;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
******************************************************************** ********************************************************************
function: residue backend 0 implementation 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){ ...@@ -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;){ for(i=info->begin,l=0;i<info->end;){
/* fetch the partition word for each channel */ /* fetch the partition word for each channel */
for(j=0;j<ch;j++) for(j=0;j<ch;j++){
partword[j]=look->decodemap[vorbis_book_decode(look->phrasebook, int temp=vorbis_book_decode(look->phrasebook,&vb->opb);
&vb->opb)]; partword[j]=look->decodemap[temp];
if(partword[j]==NULL)exit(1);
}
/* now we decode interleaved residual values for the partitions */ /* now we decode interleaved residual values for the partitions */
for(k=0;k<partitions_per_word;k++,l++,i+=samples_per_partition) for(k=0;k<partitions_per_word;k++,l++,i+=samples_per_partition)
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
******************************************************************** ********************************************************************
function: stdio-based convenience library for opening/seeking/decoding 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){ ...@@ -486,7 +486,7 @@ static int _process_packet(OggVorbis_File *vf,int readp){
vf->current_link=link; vf->current_link=link;
ogg_stream_init(&vf->os,vf->current_serialno); ogg_stream_init(&vf->os,vf->current_serialno);
ogg_stream_reset(&vf->os,ogg_page_pageno(&og)); ogg_stream_reset(&vf->os);
}else{ }else{
/* we're streaming */ /* 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