change libeplayer3 to own thread class

This commit is contained in:
smogm
2015-01-12 20:26:52 +01:00
parent 46166da4ec
commit 9ed0a0d244
8 changed files with 47 additions and 55 deletions

View File

@@ -280,17 +280,17 @@ static int lock_callback(void **mutex, enum AVLockOp op)
{
switch (op) {
case AV_LOCK_CREATE:
*mutex = (void *) new OpenThreads::Mutex;
*mutex = (void *) new Mutex;
return !*mutex;
case AV_LOCK_DESTROY:
delete static_cast<OpenThreads::Mutex *>(*mutex);
delete static_cast<Mutex *>(*mutex);
*mutex = NULL;
return 0;
case AV_LOCK_OBTAIN:
static_cast<OpenThreads::Mutex *>(*mutex)->lock();
static_cast<Mutex *>(*mutex)->lock();
return 0;
case AV_LOCK_RELEASE:
static_cast<OpenThreads::Mutex *>(*mutex)->unlock();
static_cast<Mutex *>(*mutex)->unlock();
return 0;
default:
return -1;
@@ -589,7 +589,7 @@ bool Input::Stop()
usleep(100000);
if (avfc) {
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(mutex);
ScopedLock lock(mutex);
for (unsigned int i = 0; i < avfc->nb_streams; i++)
avcodec_close(avfc->streams[i]->codec);
avformat_close_input(&avfc);