1.0.8
using the name of first audio or video as the output ts file's main name
正在显示
1 个修改的文件
包含
12 行增加
和
5 行删除
| @@ -799,10 +799,17 @@ int concate_files_and_adjust_timecode(const char * output_dest_file){ | @@ -799,10 +799,17 @@ int concate_files_and_adjust_timecode(const char * output_dest_file){ | ||
| 799 | 799 | ||
| 800 | 800 | ||
| 801 | int get_output_file_name(int i, const char * file_prefix, char * outputfile){ | 801 | int get_output_file_name(int i, const char * file_prefix, char * outputfile){ |
| 802 | - char prefix[24]; | ||
| 803 | - strncpy(prefix, file_prefix, 18); | ||
| 804 | - prefix[18] = 0; | ||
| 805 | - sprintf(outputfile, "%s_%d.ts", prefix, i); | 802 | + char prefix[128]; |
| 803 | + const char * p = strstr(file_prefix, "."); | ||
| 804 | + if (p) { | ||
| 805 | + strncpy(prefix, file_prefix, p - file_prefix); | ||
| 806 | + prefix[p - file_prefix] = 0; | ||
| 807 | + } | ||
| 808 | + else { | ||
| 809 | + strcpy(prefix, file_prefix); | ||
| 810 | + } | ||
| 811 | + | ||
| 812 | + sprintf(outputfile, "%s.ts", prefix, i); | ||
| 806 | return 0; | 813 | return 0; |
| 807 | } | 814 | } |
| 808 | 815 | ||
| @@ -997,7 +1004,7 @@ void get_outinfo_file_name(char * input) | @@ -997,7 +1004,7 @@ void get_outinfo_file_name(char * input) | ||
| 997 | int main(int argc, char * argv[]) | 1004 | int main(int argc, char * argv[]) |
| 998 | { | 1005 | { |
| 999 | if (argc < 2) { | 1006 | if (argc < 2) { |
| 1000 | - printf(" merge_av 1.0.7\n"); | 1007 | + printf(" merge_av 1.0.8\n"); |
| 1001 | printf(" run ffmpeg to merge audio and video files according to the record info file,\nusage:"); | 1008 | printf(" run ffmpeg to merge audio and video files according to the record info file,\nusage:"); |
| 1002 | printf("\n %s record_info_filename [-p] [-k]", argv[0]); | 1009 | printf("\n %s record_info_filename [-p] [-k]", argv[0]); |
| 1003 | printf("\n -p :only print the command,don't run ffmpeg"); | 1010 | printf("\n -p :only print the command,don't run ffmpeg"); |
-
请 注册 或 登录 后发表评论