This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit aa1aad59f532447f7984e39e2055654460927eda Author: Zhao Zhili <[email protected]> AuthorDate: Sun Aug 2 15:00:05 2026 +0800 Commit: Zhao Zhili <[email protected]> CommitDate: Sat Sep 26 15:32:47 2026 +0000 avfilter/dnn: replace DNNCond by AVCond The DNNCond / dnn_cond_* macros in safe_queue.c were guarded by HAVE_PTHREAD_CANCEL, but none of them call pthread_cancel(). The guard was semantically wrong. AVCond provides both a threads and a no-thread fallback path, so the conditional compilation is no longer needed here. --- libavfilter/dnn/safe_queue.c | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/libavfilter/dnn/safe_queue.c b/libavfilter/dnn/safe_queue.c index f7aa31d42e..1dedac8970 100644 --- a/libavfilter/dnn/safe_queue.c +++ b/libavfilter/dnn/safe_queue.c @@ -22,31 +22,12 @@ #include "queue.h" #include "safe_queue.h" #include "libavutil/mem.h" -#include "libavutil/avassert.h" #include "libavutil/thread.h" -#if HAVE_PTHREAD_CANCEL -#define DNNCond pthread_cond_t -#define dnn_cond_init pthread_cond_init -#define dnn_cond_destroy pthread_cond_destroy -#define dnn_cond_signal pthread_cond_signal -#define dnn_cond_wait pthread_cond_wait -#else -#define DNNCond char -static inline int dnn_cond_init(DNNCond *cond, const void *attr) { return 0; } -static inline int dnn_cond_destroy(DNNCond *cond) { return 0; } -static inline int dnn_cond_signal(DNNCond *cond) { return 0; } -static inline int dnn_cond_wait(DNNCond *cond, AVMutex *mutex) -{ - av_assert0(!"should not reach here"); - return 0; -} -#endif - struct SafeQueue { Queue *q; AVMutex mutex; - DNNCond cond; + AVCond cond; }; SafeQueue *ff_safe_queue_create(void) @@ -62,7 +43,7 @@ SafeQueue *ff_safe_queue_create(void) } ff_mutex_init(&sq->mutex, NULL); - dnn_cond_init(&sq->cond, NULL); + ff_cond_init(&sq->cond, NULL); return sq; } @@ -73,7 +54,7 @@ void ff_safe_queue_destroy(SafeQueue *sq) ff_queue_destroy(sq->q); ff_mutex_destroy(&sq->mutex); - dnn_cond_destroy(&sq->cond); + ff_cond_destroy(&sq->cond); av_freep(&sq); } @@ -89,7 +70,7 @@ void ff_safe_queue_wait_for_size(SafeQueue *sq, size_t min_size) ff_mutex_lock(&sq->mutex); while (ff_queue_size(sq->q) < min_size) - dnn_cond_wait(&sq->cond, &sq->mutex); + ff_cond_wait(&sq->cond, &sq->mutex); ff_mutex_unlock(&sq->mutex); } @@ -98,7 +79,7 @@ int ff_safe_queue_push_front(SafeQueue *sq, void *v) int ret; ff_mutex_lock(&sq->mutex); ret = ff_queue_push_front(sq->q, v); - dnn_cond_signal(&sq->cond); + ff_cond_signal(&sq->cond); ff_mutex_unlock(&sq->mutex); return ret; } @@ -108,7 +89,7 @@ int ff_safe_queue_push_back(SafeQueue *sq, void *v) int ret; ff_mutex_lock(&sq->mutex); ret = ff_queue_push_back(sq->q, v); - dnn_cond_signal(&sq->cond); + ff_cond_signal(&sq->cond); ff_mutex_unlock(&sq->mutex); return ret; } @@ -118,10 +99,10 @@ void *ff_safe_queue_pop_front(SafeQueue *sq) void *value; ff_mutex_lock(&sq->mutex); while (ff_queue_size(sq->q) == 0) { - dnn_cond_wait(&sq->cond, &sq->mutex); + ff_cond_wait(&sq->cond, &sq->mutex); } value = ff_queue_pop_front(sq->q); - dnn_cond_signal(&sq->cond); + ff_cond_signal(&sq->cond); ff_mutex_unlock(&sq->mutex); return value; } -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
