On Sun, Apr 13, 2008 at 12:39:58PM +0200, jujulj wrote: > On Sat, Apr 12, 2008 at 11:01 PM, Michael Niedermayer <[EMAIL PROTECTED]> > wrote: > > On Thu, Apr 10, 2008 at 10:46:38AM +0200, jujulj wrote: > > > 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? > > [...] > > > > > > Yes, > > > > Ohh this is bad, i suggest you learn C. Especially the difference between > > bytes and int16_t. :) > > > > [...] > > -- > > Why don't you just tell me what's wrong?
A byte has 8 bits, a int16_t has 16 bits and thus is 2 bytes. You mix these 2 concepts thus you end up with nonsense. The problem is not at all related to ffmpeg. > I suggest you learn pedagogy. Iam not trying to teach, you are trying to write a program. [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB It is dangerous to be right in matters on which the established authorities are wrong. -- Voltaire
signature.asc
Description: Digital signature
_______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
