mirror of
https://github.com/zoriya/go-mediainfo.git
synced 2026-05-28 00:51:34 +00:00
code formatting
This commit is contained in:
+12
-10
@@ -5,8 +5,8 @@
|
||||
|
||||
const wchar_t *toWchar(const char *c)
|
||||
{
|
||||
const size_t cSize = strlen(c)+1;
|
||||
wchar_t* wc = malloc(cSize * sizeof(wchar_t));
|
||||
const size_t cSize = strlen(c) + 1;
|
||||
wchar_t *wc = malloc(cSize * sizeof(wchar_t));
|
||||
mbstowcs(wc, c, cSize);
|
||||
|
||||
return wc;
|
||||
@@ -14,8 +14,8 @@ const wchar_t *toWchar(const char *c)
|
||||
|
||||
const char *toChar(const wchar_t *c)
|
||||
{
|
||||
const size_t cSize = wcslen(c)+1;
|
||||
char* wc = malloc(cSize * sizeof(char));
|
||||
const size_t cSize = wcslen(c) + 1;
|
||||
char *wc = malloc(cSize * sizeof(char));
|
||||
wcstombs(wc, c, cSize);
|
||||
|
||||
return wc;
|
||||
@@ -23,13 +23,15 @@ const char *toChar(const wchar_t *c)
|
||||
|
||||
void *OpenFile(char *filePath)
|
||||
{
|
||||
void* handle = MediaInfo_New();
|
||||
if (!handle) {
|
||||
void *handle = MediaInfo_New();
|
||||
if (!handle)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t res = MediaInfo_Open(handle, toWchar(filePath));
|
||||
if (!res) {
|
||||
if (!res)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -42,17 +44,17 @@ void CloseFile(void *handle)
|
||||
MediaInfo_Delete(handle);
|
||||
}
|
||||
|
||||
const char* Get(void *handle, MediaInfo_stream_C streamKind, size_t StreamNumber, char* Parameter, MediaInfo_info_C KindOfInfo, MediaInfo_info_C KindOfSearch)
|
||||
const char *Get(void *handle, MediaInfo_stream_C streamKind, size_t StreamNumber, char *Parameter, MediaInfo_info_C KindOfInfo, MediaInfo_info_C KindOfSearch)
|
||||
{
|
||||
return toChar(MediaInfo_Get(handle, streamKind, StreamNumber, toWchar(Parameter), KindOfInfo, KindOfSearch));
|
||||
}
|
||||
|
||||
const char* Option(void *handle, char* Parameter, char* Value)
|
||||
const char *Option(void *handle, char *Parameter, char *Value)
|
||||
{
|
||||
return toChar(MediaInfo_Option(handle, toWchar(Parameter), toWchar(Value)));
|
||||
}
|
||||
|
||||
const char* Inform(void *handle, size_t Reserved)
|
||||
const char *Inform(void *handle, size_t Reserved)
|
||||
{
|
||||
return toChar(MediaInfo_Inform(handle, Reserved));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user