Mercurial > mplayer.hg
comparison loader/win32.c @ 7718:05ded2e1327a
fixed 2 10l bugs, ATI VCR2 dll now working
author | alex |
---|---|
date | Sat, 12 Oct 2002 16:40:56 +0000 |
parents | 174e2a58b4cd |
children | be9a2636b071 |
comparison
equal
deleted
inserted
replaced
7717:14fc17fce5bd | 7718:05ded2e1327a |
---|---|
1241 struct CRITSECT* cs = mreq_private(sizeof(struct CRITSECT) + sizeof(CRITICAL_SECTION), | 1241 struct CRITSECT* cs = mreq_private(sizeof(struct CRITSECT) + sizeof(CRITICAL_SECTION), |
1242 0, AREATYPE_CRITSECT); | 1242 0, AREATYPE_CRITSECT); |
1243 pthread_mutex_init(&cs->mutex, NULL); | 1243 pthread_mutex_init(&cs->mutex, NULL); |
1244 cs->locked=0; | 1244 cs->locked=0; |
1245 cs->deadbeef = 0xdeadbeef; | 1245 cs->deadbeef = 0xdeadbeef; |
1246 *(void**)c = cs + 1; | 1246 *(void**)c = cs; |
1247 } | 1247 } |
1248 #endif | 1248 #endif |
1249 return; | 1249 return; |
1250 } | 1250 } |
1251 | 1251 |
1252 static void WINAPI expEnterCriticalSection(CRITICAL_SECTION* c) | 1252 static void WINAPI expEnterCriticalSection(CRITICAL_SECTION* c) |
1253 { | 1253 { |
1254 #ifdef CRITSECS_NEWTYPE | 1254 #ifdef CRITSECS_NEWTYPE |
1255 struct CRITSECT* cs = critsecs_get_unix(c); | 1255 struct CRITSECT* cs = critsecs_get_unix(c); |
1256 #else | 1256 #else |
1257 struct CRITSECT* cs = (*(struct CRITSECT**)c) - 1; | 1257 struct CRITSECT* cs = (*(struct CRITSECT**)c); |
1258 | |
1259 #endif | 1258 #endif |
1260 dbgprintf("EnterCriticalSection(0x%x) %p maso:0x%x\n",c, cs, cs->deadbeef); | 1259 dbgprintf("EnterCriticalSection(0x%x) %p maso:0x%x\n",c, cs, (cs)?cs->deadbeef:NULL); |
1261 if (!cs) | 1260 if (!cs) |
1262 { | 1261 { |
1263 dbgprintf("entered uninitialized critisec!\n"); | 1262 dbgprintf("entered uninitialized critisec!\n"); |
1264 expInitializeCriticalSection(c); | 1263 expInitializeCriticalSection(c); |
1265 #ifdef CRITSECS_NEWTYPE | 1264 #ifdef CRITSECS_NEWTYPE |
1266 cs=critsecs_get_unix(c); | 1265 cs=critsecs_get_unix(c); |
1267 #else | 1266 #else |
1268 cs = (*(struct CRITSECT**)c) - 1; | 1267 cs = (*(struct CRITSECT**)c); |
1269 #endif | 1268 #endif |
1270 printf("Win32 Warning: Accessed uninitialized Critical Section (%p)!\n", c); | 1269 printf("Win32 Warning: Accessed uninitialized Critical Section (%p)!\n", c); |
1271 } | 1270 } |
1272 if(cs->locked) | 1271 if(cs->locked) |
1273 if(cs->id==pthread_self()) | 1272 if(cs->id==pthread_self()) |
1280 static void WINAPI expLeaveCriticalSection(CRITICAL_SECTION* c) | 1279 static void WINAPI expLeaveCriticalSection(CRITICAL_SECTION* c) |
1281 { | 1280 { |
1282 #ifdef CRITSECS_NEWTYPE | 1281 #ifdef CRITSECS_NEWTYPE |
1283 struct CRITSECT* cs = critsecs_get_unix(c); | 1282 struct CRITSECT* cs = critsecs_get_unix(c); |
1284 #else | 1283 #else |
1285 struct CRITSECT* cs = (*(struct CRITSECT**)c) - 1; | 1284 struct CRITSECT* cs = (*(struct CRITSECT**)c); |
1286 #endif | 1285 #endif |
1287 // struct CRITSECT* cs=(struct CRITSECT*)c; | 1286 // struct CRITSECT* cs=(struct CRITSECT*)c; |
1288 dbgprintf("LeaveCriticalSection(0x%x) 0x%x\n",c, cs->deadbeef); | 1287 dbgprintf("LeaveCriticalSection(0x%x) 0x%x\n",c, cs->deadbeef); |
1289 if (!cs) | 1288 if (!cs) |
1290 { | 1289 { |
1298 static void WINAPI expDeleteCriticalSection(CRITICAL_SECTION *c) | 1297 static void WINAPI expDeleteCriticalSection(CRITICAL_SECTION *c) |
1299 { | 1298 { |
1300 #ifdef CRITSECS_NEWTYPE | 1299 #ifdef CRITSECS_NEWTYPE |
1301 struct CRITSECT* cs = critsecs_get_unix(c); | 1300 struct CRITSECT* cs = critsecs_get_unix(c); |
1302 #else | 1301 #else |
1303 struct CRITSECT* cs= (*(struct CRITSECT**)c) - 1; | 1302 struct CRITSECT* cs= (*(struct CRITSECT**)c); |
1304 #endif | 1303 #endif |
1305 // struct CRITSECT* cs=(struct CRITSECT*)c; | 1304 // struct CRITSECT* cs=(struct CRITSECT*)c; |
1306 dbgprintf("DeleteCriticalSection(0x%x)\n",c); | 1305 dbgprintf("DeleteCriticalSection(0x%x)\n",c); |
1307 | 1306 |
1308 #ifndef GARBAGE | 1307 #ifndef GARBAGE |