> On 01 Jul 2015, at 05:57, Zhang Rui <bbcal...@gmail.com> wrote: > >> +static void videotoolbox_default_free(AVCodecContext *avctx) >> +{ >> + AVVideotoolboxContext *videotoolbox = avctx->hwaccel_context; >> + >> + if (videotoolbox) { >> + if (videotoolbox->cm_fmt_desc) >> + CFRelease(videotoolbox->cm_fmt_desc); >> + >> + if (videotoolbox->session) > > Better add VTDecompressionSessionWaitForAsynchronousFrames() here, > in case it is removed from videotoolbox_session_decode_frame() in > future by chance. > > Callback could be called even after VTDecompressionSessionInvalidate() > when I try to work with flag kVTDecodeFrame_EnableAsynchronousDecompression > and without VTDecompressionSessionWaitForAsynchronousFrames() per sample > in my own player.
Thanks for the information. In asynchronous decoding the VTDecompressionSessionWaitForAsynchronousFrames() function should be called before invalidating the decompression session in order to flush delayed frames (this function automatically calls the VTDecompressionSessionFinishDelayedFrames() function). In the current implementation the kVTDecodeFrame_EnableAsynchronousDecompression flag is not set and the user is not able to change the parameters passed to the videotoolbox decode function. So the decoding is synchronous and the current place for flushing the delayed frames is a good one :) >> [...] Best Regards, -- Sebastien Zwickert _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel