Am 14.08.2017 um 15:42 schrieb Yogender Gupta: >>> Applied with a slightly changed logic to achieve the same with fewer lines. > > I just tested, the modified logic doesn't work as none of the stages are > initialized. >
True, I mis-read the array name as being identical. - ctx->outputs[0]->hw_frames_ctx = av_buffer_ref(s->stages[last_stage > 0 ? last_stage : 0].frames_ctx); + if (last_stage < 0) + ctx->outputs[0]->hw_frames_ctx = av_buffer_ref(ctx->inputs[0]->hw_frames_ctx); + else + ctx->outputs[0]->hw_frames_ctx = av_buffer_ref(s->stages[last_stage].frames_ctx); + This should be good? _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel