<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@宋体";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"批注框文本 Char";
        margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:9.0pt;
        font-family:"Calibri","sans-serif";}
span.Char
        {mso-style-name:"批注框文本 Char";
        mso-style-priority:99;
        mso-style-link:批注框文本;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ZH-CN" link="blue" vlink="purple" style="text-justify-trim:punctuation">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">PS:
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:24.0pt"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">I have invoke before avcodec_open2:<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:24.0pt"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-indent:24.0pt"><b><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">av_register_all();<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-indent:24.0pt"><b><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">avcodec_register_all();<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-indent:24.0pt"><b><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white"><o:p> </o:p></span></b></p>
<p class="MsoNormal" style="text-indent:24.0pt"><b><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white"><o:p> </o:p></span></b></p>
<p class="MsoNormal" style="text-indent:24.0pt"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">xukaijun<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" align="left" style="text-align:left"><b><span style="font-size:10.0pt;font-family:宋体">发件人<span lang="EN-US">:</span></span></b><span lang="EN-US" style="font-size:10.0pt;font-family:宋体"> libav-user-bounces@ffmpeg.org [mailto:libav-user-bounces@ffmpeg.org]
</span><b><span style="font-size:10.0pt;font-family:宋体">代表 </span></b><span style="font-size:10.0pt;font-family:宋体">许凯军<span lang="EN-US"><br>
</span><b>发送时间<span lang="EN-US">:</span></b><span lang="EN-US"> 2013</span>年<span lang="EN-US">7</span>月<span lang="EN-US">20</span>日<span lang="EN-US"> 18:04<br>
</span><b>收件人<span lang="EN-US">:</span></b><span lang="EN-US"> libav-user@ffmpeg.org<br>
</span><b>主题<span lang="EN-US">:</span></b><span lang="EN-US"> [Libav-user] PCMU - avcodec_open2 return -22 Unknow Error<o:p></o:p></span></span></p>
</div>
</div>
<p class="MsoNormal" align="left" style="text-align:left"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">Hi!<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">When I try to open
<b>AV_CODEC_ID_PCM_MULAW </b>by the code below:<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">Open_satus = -22.<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">    AVCodec* codec = avcodec_find_decoder(codec_id);<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">    if (!codec)<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">    {<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">        return -1;<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">    }<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">    m_ffmpeg_codec_context = avcodec_alloc_context3(codec);<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">    if (!m_ffmpeg_codec_context)<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">    {<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">        return -1;<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">    }<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">    int open_status = avcodec_open2(m_ffmpeg_codec_context, codec, NULL);<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">    if (open_status < 0)<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">    {<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">        CString formater;<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">        formater.Format("avcodec_open2 failed :%d\r\n", open_status);<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">        OutputDebugString(formater);<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">}<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">Did I make any mistakes?<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:none"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:white;mso-highlight:white">xukaijun<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:21.0pt"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>