提交 ffc60c00 编写于 作者: X Xinzheng Zhang

ios/videotoolbox: fix crash when create vtb session failed

上级 0e89d920
......@@ -1119,6 +1119,10 @@ VideoToolBoxContext* videotoolbox_create(FFPlayer* ffp, AVCodecContext* avctx)
int ret = 0;
VideoToolBoxContext *context_vtb = (VideoToolBoxContext *)mallocz(sizeof(VideoToolBoxContext));
context_vtb->sample_info_mutex = SDL_CreateMutex();
context_vtb->sample_info_cond = SDL_CreateCond();
if (!context_vtb) {
goto fail;
}
......@@ -1146,9 +1150,6 @@ VideoToolBoxContext* videotoolbox_create(FFPlayer* ffp, AVCodecContext* avctx)
context_vtb->m_sort_queue = 0;
context_vtb->m_queue_depth = 0;
context_vtb->sample_info_mutex = SDL_CreateMutex();
context_vtb->sample_info_cond = SDL_CreateCond();
SDL_SpeedSamplerReset(&context_vtb->sampler);
return context_vtb;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册