comparison oggvorbis.c @ 2637:ef44d24680d1 libavcodec

switch to native time bases
author michael
date Sat, 30 Apr 2005 21:43:59 +0000
parents 0433866b1075
children 0975710cf7f4
comparison
equal deleted inserted replaced
2636:2344c6713011 2637:ef44d24680d1
138 if(context->buffer_index){ 138 if(context->buffer_index){
139 ogg_packet *op2= (ogg_packet*)context->buffer; 139 ogg_packet *op2= (ogg_packet*)context->buffer;
140 op2->packet = context->buffer + sizeof(ogg_packet); 140 op2->packet = context->buffer + sizeof(ogg_packet);
141 141
142 l= op2->bytes; 142 l= op2->bytes;
143 avccontext->coded_frame->pts= av_rescale(op2->granulepos, AV_TIME_BASE, avccontext->sample_rate); 143 avccontext->coded_frame->pts= op2->granulepos;
144 144
145 memcpy(packets, op2->packet, l); 145 memcpy(packets, op2->packet, l);
146 context->buffer_index -= l + sizeof(ogg_packet); 146 context->buffer_index -= l + sizeof(ogg_packet);
147 memcpy(context->buffer, context->buffer + l + sizeof(ogg_packet), context->buffer_index); 147 memcpy(context->buffer, context->buffer + l + sizeof(ogg_packet), context->buffer_index);
148 // av_log(avccontext, AV_LOG_DEBUG, "E%d\n", l); 148 // av_log(avccontext, AV_LOG_DEBUG, "E%d\n", l);
201 return -1; 201 return -1;
202 } 202 }
203 } 203 }
204 avccontext->channels = context->vi.channels; 204 avccontext->channels = context->vi.channels;
205 avccontext->sample_rate = context->vi.rate; 205 avccontext->sample_rate = context->vi.rate;
206 avccontext->time_base= (AVRational){1, avccontext->sample_rate};
206 207
207 vorbis_synthesis_init(&context->vd, &context->vi); 208 vorbis_synthesis_init(&context->vd, &context->vi);
208 vorbis_block_init(&context->vd, &context->vb); 209 vorbis_block_init(&context->vd, &context->vb);
209 210
210 return 0 ; 211 return 0 ;