Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
merge_av
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
胡斌
2017-11-30 07:56:20 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
90883d039c65caba302c3e59e61db2d95f3541ca
90883d03
1 parent
28d413f9
support load audio codec param and video codec param from merge_av.cfg
显示空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
50 行增加
和
0 行删除
merge_av/merge_av.cpp
merge_av/merge_av.cpp
查看文件 @
90883d0
...
...
@@ -6,6 +6,7 @@
#include <vector>
#include <string.h>
bool
only_print
=
false
;
using
namespace
std
;
...
...
@@ -214,10 +215,59 @@ int readfile(char * filename)
return
0
;
}
#ifdef WIN32
#include <Windows.h>
char
exe_path
[
MAX_PATH
]
=
{
0
};
int
GetExePath
()
{
char
path_buffer
[
MAX_PATH
]
=
""
;
char
drive
[
32
]
=
""
;
char
dir
[
256
]
=
""
;
char
fname
[
64
]
=
""
;
char
ext
[
32
]
=
""
;
GetModuleFileNameA
(
NULL
,
path_buffer
,
256
);
_splitpath
(
path_buffer
,
drive
,
dir
,
fname
,
ext
);
strcpy
(
exe_path
,
drive
);
strcat
(
exe_path
,
dir
);
return
0
;
}
#endif
void
load_codec_param
()
{
strcpy
(
acodec_param
,
default_acodec_param
);
strcpy
(
vcodec_param
,
default_vcodec_param
);
char
cfgfile
[
1024
];
#ifdef WIN32
GetExePath
();
strcpy
(
cfgfile
,
exe_path
);
#else
strcpy
(
cfgfile
,
"~/"
;
#endif
strcat
(
cfgfile
,
"merge_av.cfg"
);
ifstream
fin
(
cfgfile
);
if
(
!
fin
)
{
return
;
}
const
int
LINE_LENGTH
=
1000
;
char
str
[
LINE_LENGTH
];
str
[
0
]
=
0
;
if
(
fin
.
getline
(
str
,
LINE_LENGTH
))
{
printf
(
"
\n
load video codec from %s: %s
\n
"
,
cfgfile
,
str
);
strcpy
(
vcodec_param
,
str
);
}
str
[
0
]
=
0
;
if
(
fin
.
getline
(
str
,
LINE_LENGTH
))
{
printf
(
"load audio codec from %s: %s
\n
"
,
cfgfile
,
str
);
strcpy
(
acodec_param
,
str
);
}
}
int
main
(
int
argc
,
char
*
argv
[])
...
...
请
注册
或
登录
后发表评论