Remove unnecessary lock
This commit is contained in:
1 parent
4b0f563a6c
commit
c96fac02c2
1 file changed
+13
-54
@@ -190,8 +190,6 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private static readonly Object _Lock = new Object();
|
|
||||||
|
|
||||||
// Defines the type of an Acinerella media stream. Currently only video and
|
// Defines the type of an Acinerella media stream. Currently only video and
|
||||||
// audio streams are supported, subtitle and data streams will be marked as
|
// audio streams are supported, subtitle and data streams will be marked as
|
||||||
// "unknown".
|
// "unknown".
|
||||||
@@ -203,10 +201,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
|||||||
|
|
||||||
public static IntPtr AcInit()
|
public static IntPtr AcInit()
|
||||||
{
|
{
|
||||||
lock (_Lock)
|
return _ac_init();
|
||||||
{
|
|
||||||
return _ac_init();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Frees an Acinerella instance.
|
// Frees an Acinerella instance.
|
||||||
@@ -216,10 +211,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
|||||||
|
|
||||||
public static void AcFree(IntPtr pAcInstance)
|
public static void AcFree(IntPtr pAcInstance)
|
||||||
{
|
{
|
||||||
lock (_Lock)
|
_ac_free(pAcInstance);
|
||||||
{
|
|
||||||
_ac_free(pAcInstance);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Opens a media file.
|
// Opens a media file.
|
||||||
@@ -274,10 +266,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
|||||||
public static Int32 AcOpen2(IntPtr pAcInstance, string filename)
|
public static Int32 AcOpen2(IntPtr pAcInstance, string filename)
|
||||||
// ReSharper restore UnusedMethodReturnValue.Global
|
// ReSharper restore UnusedMethodReturnValue.Global
|
||||||
{
|
{
|
||||||
lock (_Lock)
|
return _ac_open2(pAcInstance, filename);
|
||||||
{
|
|
||||||
return _ac_open2(pAcInstance, filename);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Closes an opened media file.
|
// Closes an opened media file.
|
||||||
@@ -287,10 +276,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
|||||||
|
|
||||||
public static void AcClose(IntPtr pAcInstance)
|
public static void AcClose(IntPtr pAcInstance)
|
||||||
{
|
{
|
||||||
lock (_Lock)
|
_ac_close(pAcInstance);
|
||||||
{
|
|
||||||
_ac_close(pAcInstance);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stores information in "pInfo" about stream number "nb".
|
// Stores information in "pInfo" about stream number "nb".
|
||||||
@@ -300,10 +286,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
|||||||
|
|
||||||
public static void AcGetStreamInfo(IntPtr pAcInstance, Int32 nb, out SACStreamInfo info)
|
public static void AcGetStreamInfo(IntPtr pAcInstance, Int32 nb, out SACStreamInfo info)
|
||||||
{
|
{
|
||||||
lock (_Lock)
|
_ac_get_stream_info(pAcInstance, nb, out info);
|
||||||
{
|
|
||||||
_ac_get_stream_info(pAcInstance, nb, out info);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reads a package from an opened media file.
|
// Reads a package from an opened media file.
|
||||||
@@ -321,10 +304,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
|||||||
|
|
||||||
public static IntPtr AcCreateVideoDecoder(IntPtr pAcInstance)
|
public static IntPtr AcCreateVideoDecoder(IntPtr pAcInstance)
|
||||||
{
|
{
|
||||||
lock (_Lock)
|
return _ac_create_video_decoder(pAcInstance);
|
||||||
{
|
|
||||||
return _ac_create_video_decoder(pAcInstance);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport(_AcDll, EntryPoint = "ac_create_audio_decoder", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
|
[DllImport(_AcDll, EntryPoint = "ac_create_audio_decoder", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
|
||||||
@@ -332,10 +312,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
|||||||
|
|
||||||
public static IntPtr AcCreateAudioDecoder(IntPtr pAcInstance)
|
public static IntPtr AcCreateAudioDecoder(IntPtr pAcInstance)
|
||||||
{
|
{
|
||||||
lock (_Lock)
|
return _ac_create_audio_decoder(pAcInstance);
|
||||||
{
|
|
||||||
return _ac_create_audio_decoder(pAcInstance);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Frees an created decoder.
|
// Frees an created decoder.
|
||||||
@@ -345,10 +322,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
|||||||
|
|
||||||
public static void AcFreeDecoder(IntPtr pAcDecoder)
|
public static void AcFreeDecoder(IntPtr pAcDecoder)
|
||||||
{
|
{
|
||||||
lock (_Lock)
|
_ac_free_decoder(pAcDecoder);
|
||||||
{
|
|
||||||
_ac_free_decoder(pAcDecoder);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decodes a package using the specified decoder. The decodec data is stored in the
|
// Decodes a package using the specified decoder. The decodec data is stored in the
|
||||||
@@ -359,10 +333,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
|||||||
|
|
||||||
public static bool AcDecodePackage(IntPtr pAcPackage, IntPtr pAcDecoder)
|
public static bool AcDecodePackage(IntPtr pAcPackage, IntPtr pAcDecoder)
|
||||||
{
|
{
|
||||||
lock (_Lock)
|
return _ac_decode_package(pAcPackage, pAcDecoder) != 0;
|
||||||
{
|
|
||||||
return _ac_decode_package(pAcPackage, pAcDecoder) != 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport(_AcDll, EntryPoint = "ac_get_audio_frame", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
|
[DllImport(_AcDll, EntryPoint = "ac_get_audio_frame", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
|
||||||
@@ -370,10 +341,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
|||||||
|
|
||||||
public static bool AcGetAudioFrame(IntPtr pAcInstance, IntPtr pAcDecoder)
|
public static bool AcGetAudioFrame(IntPtr pAcInstance, IntPtr pAcDecoder)
|
||||||
{
|
{
|
||||||
lock (_Lock)
|
return _ac_get_audio_frame(pAcInstance, pAcDecoder) != 0;
|
||||||
{
|
|
||||||
return _ac_get_audio_frame(pAcInstance, pAcDecoder) != 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport(_AcDll, EntryPoint = "ac_get_frame", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
|
[DllImport(_AcDll, EntryPoint = "ac_get_frame", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
|
||||||
@@ -381,10 +349,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
|||||||
|
|
||||||
public static bool AcGetFrame(IntPtr pAcInstance, IntPtr pAcDecoder)
|
public static bool AcGetFrame(IntPtr pAcInstance, IntPtr pAcDecoder)
|
||||||
{
|
{
|
||||||
lock (_Lock)
|
return _ac_get_frame(pAcInstance, pAcDecoder) != 0;
|
||||||
{
|
|
||||||
return _ac_get_frame(pAcInstance, pAcDecoder) != 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport(_AcDll, EntryPoint = "ac_skip_frames", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
|
[DllImport(_AcDll, EntryPoint = "ac_skip_frames", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
|
||||||
@@ -392,10 +357,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
|||||||
|
|
||||||
public static bool AcSkipFrames(IntPtr pAcInstance, IntPtr pAcDecoder, Int32 num)
|
public static bool AcSkipFrames(IntPtr pAcInstance, IntPtr pAcDecoder, Int32 num)
|
||||||
{
|
{
|
||||||
lock (_Lock)
|
return _ac_skip_frames(pAcInstance, pAcDecoder, num) != 0;
|
||||||
{
|
|
||||||
return _ac_skip_frames(pAcInstance, pAcDecoder, num) != 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Seeks to the given target position in the file. The seek funtion is not able to seek a single audio/video stream
|
// Seeks to the given target position in the file. The seek funtion is not able to seek a single audio/video stream
|
||||||
@@ -408,10 +370,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
|||||||
|
|
||||||
public static bool AcSeek(IntPtr pAcDecoder, Int32 dir, Int64 targetPos)
|
public static bool AcSeek(IntPtr pAcDecoder, Int32 dir, Int64 targetPos)
|
||||||
{
|
{
|
||||||
lock (_Lock)
|
return _ac_seek(pAcDecoder, dir, targetPos) != 0;
|
||||||
{
|
|
||||||
return _ac_seek(pAcDecoder, dir, targetPos) != 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//function ac_probe_input_buffer(buf: PChar; bufsize: Integer; filename: PChar;
|
//function ac_probe_input_buffer(buf: PChar; bufsize: Integer; filename: PChar;
|
||||||
|
|||||||
Reference in new issue
Block a user