and start counting data packet sequence numbers with 3 instead of zero
so that all the ogg packets come out of the encoder with the same
packetno fields they would have in coming out of an Ogg file (as read by
libogg, anyway).
Previously data packets started counting from zero, and the packetno
field of the returned header packets was uninitialized.
We had two choices in resolving this. One was just to add 3 to the
vorbis_dsp_state and/or vorbis_block sequence field when writing it to
the ogg_packet packetno field. The other is to actually keep the
packetno in the internal sequence fields. I chose the later based on the
fact that this same field gets set directly from the ogg_packet packetno
on decode, so things are consistent.
svn path=/trunk/vorbis/; revision=9513
********************************************************************
function: PCM data vector blocking, windowing and dis/reassembly
- last mod: $Id: block.c,v 1.76 2003/12/30 11:02:22 xiphmont Exp $
+ last mod: $Id$
Handle windowing, overlap-add, etc of the PCM vectors. This is made
more amusing by Vorbis' current two allowed block sizes.
oggpack_writeinit(vbi->packetblob[i]);
}
}
-
+
return(0);
}
vorbis_bitrate_init(vi,&b->bms);
+ /* compressed audio packets start after the headers
+ with sequence number 3 */
+ v->sequence=3;
+
return(0);
}
op->b_o_s=0;
op->e_o_s=0;
op->granulepos=0;
+ op->packetno=1;
return 0;
}
op->b_o_s=1;
op->e_o_s=0;
op->granulepos=0;
+ op->packetno=0;
/* second header packet (comments) **********************************/
op_comm->b_o_s=0;
op_comm->e_o_s=0;
op_comm->granulepos=0;
+ op_comm->packetno=1;
/* third header packet (modes/codebooks) ****************************/
op_code->b_o_s=0;
op_code->e_o_s=0;
op_code->granulepos=0;
+ op_code->packetno=2;
oggpack_writeclear(&opb);
return(0);