<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">On 2016年08月21日, at 21:31, salsaman <<a href="mailto:salsaman@gmail.com" class="">salsaman@gmail.com</a>> wrote:<br class=""><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Here we go, I can answer definitively now:<br class=""><br class=""><a href="https://ffmpeg.org/doxygen/3.1/ffplay_8c_source.html" class="">https://ffmpeg.org/doxygen/3.1/ffplay_8c_source.html</a><br class=""><br class=""><br class=""><a style="" class="" href="https://ffmpeg.org/doxygen/3.1/structAVCodecContext.html">AVCodecContext</a> *avctx;<br class=""><br class=""><div class="">avctx = <a class="" href="https://ffmpeg.org/doxygen/3.1/group__lavc__core.html#gae80afec6f26df6607eaacf39b561c315">avcodec_alloc_context3</a>(<a class="" href="https://ffmpeg.org/doxygen/3.1/coverity_8c.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>);</div>
<div class=""><a name="l02652" class=""></a><span class=""> </span><span class="">if</span> (!avctx)</div>
<div class=""><a name="l02653" class=""></a><span class=""> </span>         <span class="">return</span> <a class="" href="https://ffmpeg.org/doxygen/3.1/group__lavu__error.html#gae4bb6f165973d09584e0ec0f335f69ca">AVERROR</a>(ENOMEM);</div>
<div class=""><a name="l02654" class=""></a><span class=""> </span> <br class=""></div>
<div class=""><a name="l02655" class=""></a><span class=""> </span>ret = <a class="" href="https://ffmpeg.org/doxygen/3.1/group__lavc__core.html#gac7b282f51540ca7a99416a3ba6ee0d16">avcodec_parameters_to_context</a>(avctx, ic-><a class="" href="https://ffmpeg.org/doxygen/3.1/structAVFormatContext.html#acfefb6b6cf21e87a0dcbd1a547ba2348">streams</a>[stream_index]-><a class="" href="https://ffmpeg.org/doxygen/3.1/structAVStream.html#a12826d21779289356722971d362c583c">codecpar</a>);</div>
<div class=""><a name="l02656" class=""></a><span class=""> </span><span class="">if</span> (ret < 0)</div>
<div class=""><a name="l02657" class=""></a><span class=""> </span>        <span class="">goto</span> <a class="" href="https://ffmpeg.org/doxygen/3.1/checkasm_8h.html#a73a3b169ac8c3419cbe15327e75ffcfd">fail</a>;</div></div></div></div></blockquote></div><br class=""><div class="">You are explaining what replaces codec parameter setting, which I have already familiarized myself with.  This does not answer the question I originally asked, which is how I am to call avcodec_close (and other functions) which require an AVCodecContext, when that field is deprecated.  Using avformat_new_stream’s docucomments specify these calls are necessary to clean up when done with the stream.</div><div class=""><br class=""></div><div class="">Perette</div><div class=""><br class=""></div></body></html>