On 2 December 2014 at 19:27, Lukasz Marek <lukasz.m.lu...@gmail.com> wrote:
> Context copied from open context cannot be treated as opened. > avcodec_open2 modifies context so reopening it is also questionable. > It is worth to warn when it happens. > > Signed-off-by: Lukasz Marek <lukasz.m.lu...@gmail.com> > --- > libavcodec/options.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/libavcodec/options.c b/libavcodec/options.c > index 3dd5df3..dab5140 100644 > --- a/libavcodec/options.c > +++ b/libavcodec/options.c > @@ -182,6 +182,9 @@ int avcodec_copy_context(AVCodecContext *dest, const > AVCodecContext *src) > const AVCodec *orig_codec = dest->codec; > uint8_t *orig_priv_data = dest->priv_data; > > + if (avcodec_is_open(src)) > + av_log(dest, AV_LOG_WARNING, "AVCodecContext is copied from > opened context.\n"); > I still think copying opened codec is a bit tricky, but this would spam this warning by ffmpeg, so dropped. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel