Hello,
I want to decode MP3 file. Following is what I did.
1) Called avcodec_init()2) Called avcodec_register_all()3) AVCodec* pCodec = 
avcodec_find_decoder(CODEC_ID_MP3)4) AVCodecContext* pCodecContext = 
avcodec_alloc_context();5) avcodec_open(pCodecContext, pCodec);6) Read MP3 file 
data into some buffer (pInputMP3Buffer);7) Called        int iBufferStart  = 0;
      do{       int iDecodedBytes = avcodec_decode_audio2(pCodecContext, 
pOutBuffer, &iOutBuffLen, &pInputMP3Buffer[iBufferStart], 
iInputBufferSize);iBufferStart = iBufferStart + iDecodedBytes;
iInputBufferSize = iInputBufferSize - iDecodedBytes;

} while(iInputBufferSize >0);


BUT avcodec_decode_audio2 always returns -1;
Please help.
Thanks,-Amol.


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

Reply via email to