File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 3
3
4
4
#define TAG " FFMpegIDecoder"
5
5
6
- static IDecoder* sInstance ;
7
-
8
6
IDecoder::IDecoder ()
9
7
{
10
8
mQueue = new PacketQueue ();
11
- sInstance = this ;
12
9
}
13
10
14
11
IDecoder::~IDecoder ()
@@ -46,7 +43,7 @@ bool IDecoder::startAsync(const char* err)
46
43
return false ;
47
44
}
48
45
49
- pthread_create (&mThread , NULL , startDecoding, NULL );
46
+ pthread_create (&mThread , NULL , startDecoding, this );
50
47
return true ;
51
48
}
52
49
@@ -73,9 +70,10 @@ void IDecoder::stop()
73
70
void * IDecoder::startDecoding (void * ptr)
74
71
{
75
72
__android_log_print (ANDROID_LOG_INFO, TAG, " starting decoder thread" );
76
- sInstance ->mDecoding = true ;
77
- sInstance ->decode (ptr);
78
- sInstance ->mDecoding = false ;
73
+ IDecoder* decoder = (IDecoder *) ptr;
74
+ decoder->mDecoding = true ;
75
+ decoder->decode (ptr);
76
+ decoder->mDecoding = false ;
79
77
}
80
78
81
79
bool IDecoder::prepare (const char *err)
You can’t perform that action at this time.
0 commit comments