jujulj wrote:
> 16 bits...
Please dont top-post; trim old sigs and similar cruft when replying; and
preferrably post complete code that one can compile and try without a
lot of effort.
>
>
> On Thu, Apr 3, 2008 at 8:17 PM, gradouble <[EMAIL PROTECTED]> wrote:
>> jujulj a écrit :
>>
>>
>>> hi again,
>> >
>> > I did a lot of progress in my audio decoder, but I've still got one
>> > problem: I'm getting twice as many decoded values as expected, and for
>> > each decoded frame, the second half is 0s.
>> >
>> > What am I doing wrong?
>> >
>> > thank you
>> > jul
>> >
>> >
>> > My decoding loop:
>> >
>> >
>> > int count=0;
>> >
>> > while(1)
>> > {
>> > // Free old avPacket
>> > if(avPacket.data!=NULL)
>> > av_free_packet(&avPacket);
>> >
>> > // Read new avPacket
>> > if(av_read_frame(pFormatCtx, &avPacket)<0)
>> > {
>> > printf("done\n");
>> > break;//the job is done
>> > }
>> >
>> > static int16_t output_buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3)/2];
>> > int len;
>> > int outputbuffersize = (AVCODEC_MAX_AUDIO_FRAME_SIZE * 3)/2;
>> >
>> > len = avcodec_decode_audio2(pAudioCodecCtx, output_buf,
>> > &outputbuffersize, avPacket.data , avPacket.size);
>> >
>> > count+=len;
>> >
>> > if(len<0)
>> > return -1;
>> >
>> > if (outputbuffersize <= 0)
>> > return -1;
>> > else
>> > {
>> > for(int j=0;j<outputbuffersize;j++)
>> > fprintf(outfile,"%d\n",output_buf[j]);
>> > }
>> >
>> > }
[snip]
--
Michel Bardiaux
http://www.mediaxim.com/
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user