History

avcodec/pthread_slice: Return error on error

Andreas Rheinhardt committed 1 year ago

Commit 7d1bf0a1 parent c82101c1 file · +7 −5Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/pthread_slice.c+7−5
@@ -132,14 +132,16 @@ av_cold int ff_slice_thread_init(AVCodecContext *avctx) · 131 unmodified lines
132 }132 }
133 133
134 avctx->internal->thread_ctx = c = av_mallocz(sizeof(*c));134 avctx->internal->thread_ctx = c = av_mallocz(sizeof(*c));
135 if (!c)
136 return AVERROR(ENOMEM);
135 mainfunc = ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_SLICE_THREAD_HAS_MF ? &main_function : NULL;137 mainfunc = ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_SLICE_THREAD_HAS_MF ? &main_function : NULL;
136 if (!c || (thread_count = avpriv_slicethread_create(&c->thread, avctx, worker_func, mainfunc, thread_count)) <= 1) {138 thread_count = avpriv_slicethread_create(&c->thread, avctx, worker_func,
137 if (c)139 mainfunc, thread_count);
138 avpriv_slicethread_free(&c->thread);140 if (thread_count <= 1) {
139 av_freep(&avctx->internal->thread_ctx);141 ff_slice_thread_free(avctx);
140 avctx->thread_count = 1;142 avctx->thread_count = 1;
141 avctx->active_thread_type = 0;143 avctx->active_thread_type = 0;
142 return 0;144 return thread_count < 0 ? thread_count : 0;
143 }145 }
144 avctx->thread_count = thread_count;146 avctx->thread_count = thread_count;
145 147

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t