diff options
author | Monty <xiphmont@xiph.org> | 2000-04-03 09:45:55 +0000 |
---|---|---|
committer | Monty <xiphmont@xiph.org> | 2000-04-03 09:45:55 +0000 |
commit | ec9141a08b19f4f84b162f4ae59d449f7b6eb8e4 (patch) | |
tree | 6631d1ed507afbed1e7fcb86211d3444f3ed0797 | |
parent | 94b6b160e49bced8c94bcf695f7e04cae666275a (diff) | |
download | libvorbis-git-ec9141a08b19f4f84b162f4ae59d449f7b6eb8e4.tar.gz |
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
-rw-r--r-- | include/vorbis/codec.h | 4 | ||||
-rw-r--r-- | lib/framing.c | 12 | ||||
-rw-r--r-- | lib/res0.c | 10 | ||||
-rw-r--r-- | 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; @@ -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) diff --git a/lib/vorbisfile.c b/lib/vorbisfile.c index 3666fb4b..055b3473 100644 --- a/lib/vorbisfile.c +++ b/lib/vorbisfile.c @@ -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 */ |