[FFmpeg-trac] #1037(avcodec:new): avcodec_alloc_context3 and avcodec_alloc_frame causes app to exit on Android 3.2

FFmpeg trac at avcodec.org
Tue Mar 6 10:31:43 CET 2012


#1037: avcodec_alloc_context3 and avcodec_alloc_frame  causes app to exit on
Android 3.2
-----------------------------------+-----------------------------------
             Reporter:  pawg       |                    Owner:
                 Type:  defect     |                   Status:  new
             Priority:  important  |                Component:  avcodec
              Version:  0.10       |               Resolution:
             Keywords:             |               Blocked By:
             Blocking:             |  Reproduced by developer:  0
Analyzed by developer:  0          |
-----------------------------------+-----------------------------------

Comment (by pawg):

 My codec initialization function is the following:

 AVCodec* myCodec;
 AVCodecContext* myContext;
 AVFrame* myFrame;


 init(){

     avcodec_init();
     avcodec_register_all();
     myCodec = NULL;

     myCodec = avcodec_find_decoder(CODEC_ID_H264);
     if (!myCodec) {
         log.error("codec CODEC_ID_H264 not found");
         return;
     }


     /*this function causes the application to exit, the same goes for
 avcodec_alloc_frame if I comment this line*/
     myContext = avcodec_alloc_context3(myCodec);

     if (myCodec->capabilities & CODEC_CAP_TRUNCATED)
         myContext->flags |= CODEC_FLAG_TRUNCATED;

     myContext->flags2 |= (CODEC_FLAG2_CHUNKS | CODEC_FLAG_TRUNCATED);

    if (avcodec_open(myContext, myCodec) < 0) {
         log.error("Could not open codec");
         return;
     }
     myFrame = avcodec_alloc_frame();
     log.information("initialized decoder");
 }

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/1037#comment:4>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list