File tree Expand file tree Collapse file tree
app/src/main/cpp/visualizer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ class SafeQueue {
3939
4040 void push (T new_value) {
4141#ifdef C11
42- // 锁 和智能指针原理类似,自动释放
4342 lock_guard<mutex> lk (mt);
4443 if (work) {
4544 q.push (new_value);
@@ -62,9 +61,7 @@ class SafeQueue {
6261 int pop (T &value) {
6362 int ret = 0 ;
6463#ifdef C11
65- // 占用空间相对lock_guard 更大一点且相对更慢一点,但是配合条件必须使用它,更灵活
6664 unique_lock<mutex> lk (mt);
67- // 第二个参数 lambda表达式:false则不阻塞 往下走
6865 cv.wait (lk,[this ]{return !work || !q.empty ();});
6966 if (!q.empty ()) {
7067 value = q.front ();
@@ -105,7 +102,7 @@ class SafeQueue {
105102 }
106103
107104 int size () {
108- return q.size ();
105+ return static_cast < int >( q.size () );
109106 }
110107
111108 void clear () {
@@ -119,7 +116,7 @@ class SafeQueue {
119116 }
120117#else
121118 pthread_mutex_lock (&mutex);
122- int size = q.size ();
119+ int size = static_cast < int >( q.size () );
123120 for (int i = 0 ; i < size; ++i) {
124121 T value = q.front ();
125122 releaseCallback (value);
Original file line number Diff line number Diff line change 22// Created by frank on 2021/8/16.
33//
44
5- #ifndef PLAYER_CORE_RUN_FFT_H
6- #define PLAYER_CORE_RUN_FFT_H
5+ #ifndef EXECUTE_FFT_H
6+ #define EXECUTE_FFT_H
77
88#include "vlc_queue.h"
99#include "fft.h"
@@ -73,4 +73,4 @@ static void *fft_thread(void *);
7373
7474/*static*/ void close_visualizer (filter_sys_t * p_filter );
7575
76- #endif //PLAYER_CORE_RUN_FFT_H
76+ #endif //EXECUTE_FFT_H
You can’t perform that action at this time.
0 commit comments