On Wed, Apr 9, 2008 at 11:21 PM, Michael Niedermayer <[EMAIL PROTECTED]> wrote:
>
> On Fri, Apr 04, 2008 at 02:09:00PM +0200, jujulj wrote:
>  > On Fri, Apr 4, 2008 at 1:23 PM, Michel Bardiaux <[EMAIL PROTECTED]> wrote:
>  > >
>  > >  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.
>  > >
>  >
>  > ok, sorry. Here's a clean post.
>  >
>  > My problem: I'm getting twice as many decoded values as expected, and
>  > 0s in the second half of every decoded frame...
>  > My easily compilable and triable code is attached. It creates
>  > /tmp/decoded_samples.dat and printf the number of decoded values.
>  [...]
>  >     //output buffer
>  >     int16_t *output_buf;
>  >     output_buf= new int16_t[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3)/2];
>  [...]
>  >                 bytesDecoded = avcodec_decode_audio2(pAudioCodecCtx, 
> output_buf, &numAudioBytes, pIn , audioBytesRemaining);
>  [...]
>  >                             for(int j=0;j<numAudioBytes;j++)
>
> >                                     fprintf(outfile,"%d\n",output_buf[j]);
>
>  so half of the int16_t bytes are 0?
>
>  [...]
>
>  --
>  Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
>  Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
>
> -----BEGIN PGP SIGNATURE-----
>  Version: GnuPG v1.4.6 (GNU/Linux)
>
>  iD8DBQFH/TN1YR7HhwQLD6sRArD3AJ91YZ+SPrBBZCu3IRkxLtw29E4k/wCfXKul
>  Pjl+P5uGpWrCJHQA29jMBTc=
>  =nqEg
>  -----END PGP SIGNATURE-----
>
> _______________________________________________
>  libav-user mailing list
>  [email protected]
>  https://lists.mplayerhq.hu/mailman/listinfo/libav-user
>
>

Yes, and the variable count (which is the cumulative sum of
numAudioBytes) is twice as large as expected (e.g. for a 3s, mono,
44.1kH mp3 file, I get count = 3*44100*2).

By the way, if you want to try it, it takes only an audio file as argument:
audiodecoder <audiofile>

thank you

Julien
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to