[Libav-user] 答复: PCMU - avcodec_open2 return -22 Unknow Error

许凯军 xukaijun at hikvision.com
Sat Jul 20 12:06:47 CEST 2013


PS:
I have invoke before avcodec_open2:

av_register_all();
avcodec_register_all();


xukaijun

发件人: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] 代表 许凯军
发送时间: 2013年7月20日 18:04
收件人: libav-user at ffmpeg.org
主题: [Libav-user] PCMU - avcodec_open2 return -22 Unknow Error

Hi!

When I try to open AV_CODEC_ID_PCM_MULAW by the code below:
Open_satus = -22.


    AVCodec* codec = avcodec_find_decoder(codec_id);
    if (!codec)
    {
        return -1;
    }

    m_ffmpeg_codec_context = avcodec_alloc_context3(codec);

    if (!m_ffmpeg_codec_context)
    {
        return -1;
    }

    int open_status = avcodec_open2(m_ffmpeg_codec_context, codec, NULL);
    if (open_status < 0)
    {
        CString formater;
        formater.Format("avcodec_open2 failed :%d\r\n", open_status);
        OutputDebugString(formater);
}



Did I make any mistakes?

xukaijun



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130720/f32cd2fd/attachment.html>


More information about the Libav-user mailing list