<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 21, 2016 at 10:44 PM, Perette Barella <span dir="ltr"><<a href="mailto:perette@barella.org" target="_blank">perette@barella.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class="">On 2016年08月21日, at 21:31, salsaman <<a href="mailto:salsaman@gmail.com" target="_blank">salsaman@gmail.com</a>> wrote:<br><div><blockquote type="cite"><br><div><div dir="ltr"><div>Here we go, I can answer definitively now:<br><br><a href="https://ffmpeg.org/doxygen/3.1/ffplay_8c_source.html" target="_blank">https://ffmpeg.org/doxygen/3.<wbr>1/ffplay_8c_source.html</a><br><br><br><a href="https://ffmpeg.org/doxygen/3.1/structAVCodecContext.html" target="_blank">AVCodecContext</a> *avctx;<br><br><div>avctx = <a href="https://ffmpeg.org/doxygen/3.1/group__lavc__core.html#gae80afec6f26df6607eaacf39b561c315" target="_blank">avcodec_alloc_context3</a>(<a href="https://ffmpeg.org/doxygen/3.1/coverity_8c.html#a070d2ce7b6bb7e5c05602aa8c308d0c4" target="_blank">NULL</a>);</div>
<div><a name="m_7555423098820666810_l02652"></a><span> </span><span>if</span> (!avctx)</div>
<div><a name="m_7555423098820666810_l02653"></a><span> </span> <span>return</span> <a href="https://ffmpeg.org/doxygen/3.1/group__lavu__error.html#gae4bb6f165973d09584e0ec0f335f69ca" target="_blank">AVERROR</a>(ENOMEM);</div>
<div><a name="m_7555423098820666810_l02654"></a><span> </span> <br></div>
<div><a name="m_7555423098820666810_l02655"></a><span> </span>ret = <a href="https://ffmpeg.org/doxygen/3.1/group__lavc__core.html#gac7b282f51540ca7a99416a3ba6ee0d16" target="_blank">avcodec_parameters_to_context</a>(<wbr>avctx, ic-><a href="https://ffmpeg.org/doxygen/3.1/structAVFormatContext.html#acfefb6b6cf21e87a0dcbd1a547ba2348" target="_blank">streams</a>[stream_index]-><a href="https://ffmpeg.org/doxygen/3.1/structAVStream.html#a12826d21779289356722971d362c583c" target="_blank">cod<wbr>ecpar</a>);</div>
<div><a name="m_7555423098820666810_l02656"></a><span> </span><span>if</span> (ret < 0)</div>
<div><a name="m_7555423098820666810_l02657"></a><span> </span> <span>goto</span> <a href="https://ffmpeg.org/doxygen/3.1/checkasm_8h.html#a73a3b169ac8c3419cbe15327e75ffcfd" target="_blank">fail</a>;</div></div></div></div></blockquote></div><br></span><div>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><span class="HOEnZb"><font color="#888888"><div><br></div><div>Perette</div><div><br></div></font></span></div></blockquote><div><br><br></div><div>Just use avctx from the code above. I don' t see what the problem is.<br><br><br></div><div>Gabriel.<br><br><br></div><div><br><br><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class="HOEnZb"><font color="#888888"><div></div></font></span></div><br>______________________________<wbr>_________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/<wbr>listinfo/libav-user</a><br>
<br></blockquote></div><br></div></div>