forked from mia/Aegisub
FFMS2: more initialization fun
Originally committed to SVN as r2981.
This commit is contained in:
parent
72dc17af28
commit
12482ac418
3 changed files with 15 additions and 9 deletions
|
@ -32,26 +32,32 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int InitCount = 0;
|
static int InitCount = 0;
|
||||||
|
static bool FFmpegInited = false;
|
||||||
|
|
||||||
FFMS_API(int) FFMS_Init() {
|
FFMS_API(int) FFMS_Init() {
|
||||||
if (!InitCount++) {
|
if (!FFmpegInited) {
|
||||||
av_register_all();
|
av_register_all();
|
||||||
av_log_set_level(AV_LOG_QUIET);
|
av_log_set_level(AV_LOG_QUIET);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!InitCount) {
|
||||||
#ifdef HAALISOURCE
|
#ifdef HAALISOURCE
|
||||||
if (::CoInitializeEx(NULL, COINIT_MULTITHREADED) != S_OK)
|
::CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
||||||
return 1;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
|
InitCount++;
|
||||||
|
return InitCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FFMS_API(int) FFMS_DeInit() {
|
||||||
FFMS_API(void) FFMS_DeInit() {
|
InitCount--;
|
||||||
if (!--InitCount) {
|
if (!InitCount) {
|
||||||
#ifdef HAALISOURCE
|
#ifdef HAALISOURCE
|
||||||
::CoUninitialize();
|
::CoUninitialize();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
return InitCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
FFMS_API(int) FFMS_GetLogLevel() {
|
FFMS_API(int) FFMS_GetLogLevel() {
|
||||||
|
|
|
@ -123,7 +123,7 @@ typedef int (FFMS_CC *TAudioNameCallback)(const char *SourceFile, int Track, con
|
||||||
// Most functions return 0 on success
|
// Most functions return 0 on success
|
||||||
// Functions without error message output can be assumed to never fail
|
// Functions without error message output can be assumed to never fail
|
||||||
FFMS_API(int) FFMS_Init();
|
FFMS_API(int) FFMS_Init();
|
||||||
FFMS_API(void) FFMS_DeInit();
|
FFMS_API(int) FFMS_DeInit();
|
||||||
FFMS_API(int) FFMS_GetLogLevel();
|
FFMS_API(int) FFMS_GetLogLevel();
|
||||||
FFMS_API(void) FFMS_SetLogLevel(int Level);
|
FFMS_API(void) FFMS_SetLogLevel(int Level);
|
||||||
FFMS_API(FFVideo *) FFMS_CreateVideoSource(const char *SourceFile, int Track, FFIndex *Index, const char *PP, int Threads, int SeekMode, char *ErrorMsg, unsigned MsgSize);
|
FFMS_API(FFVideo *) FFMS_CreateVideoSource(const char *SourceFile, int Track, FFIndex *Index, const char *PP, int Threads, int SeekMode, char *ErrorMsg, unsigned MsgSize);
|
||||||
|
|
|
@ -251,7 +251,7 @@ Note that --enable-w32threads or --enable-pthreads is required for multithreaded
|
||||||
<li>The audio track delay is now exposed in the API in the same way as video tracks</li>
|
<li>The audio track delay is now exposed in the API in the same way as video tracks</li>
|
||||||
<li>A big type and argument name cleanup in the API, many things have been renamed to be clearer and ffms.h should be completely C friendly now</li>
|
<li>A big type and argument name cleanup in the API, many things have been renamed to be clearer and ffms.h should be completely C friendly now</li>
|
||||||
<li>Removed FFNoLog and replaced it with FFSetLogLevel and FFGetLogLevel, the default logging is now also set to quiet, the magical numbers to supply it can be found in avutil/log.h</li>
|
<li>Removed FFNoLog and replaced it with FFSetLogLevel and FFGetLogLevel, the default logging is now also set to quiet, the magical numbers to supply it can be found in avutil/log.h</li>
|
||||||
<li>Updated FFmpeg to rev X (now with faad2 again by popular demand, updated to GCC 4.4.0 for compiling all libraries)</li>
|
<li>Updated FFmpeg to rev 18930 (now with faad2 again by popular demand, updated to GCC 4.4.0 for compiling all libraries)</li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
|
|
||||||
<li>2.00 beta 8<ul>
|
<li>2.00 beta 8<ul>
|
||||||
|
|
Loading…
Reference in a new issue