improve print info
print and return error if no paramter after "-t"
正在显示
2 个修改的文件
包含
4 行增加
和
3 行删除
| @@ -25,10 +25,10 @@ int CVideoDecoder::add(media_info &info) | @@ -25,10 +25,10 @@ int CVideoDecoder::add(media_info &info) | ||
| 25 | 25 | ||
| 26 | if (_info.size() > 1) { | 26 | if (_info.size() > 1) { |
| 27 | if (_is_finished == false) { | 27 | if (_is_finished == false) { |
| 28 | - printf("add file:%s ,but the last file, %s, is not finished?", info.name.c_str(), _info[_info.size() - 2].name.c_str()); | 28 | + printf("\nadd file:%s ,but the last file, %s, is not finished?", info.name.c_str(), _info[_info.size() - 2].name.c_str()); |
| 29 | } | 29 | } |
| 30 | else { | 30 | else { |
| 31 | - printf("add file:%s ,after the last file, %s", info.name.c_str(), _info[_info.size() - 2].name.c_str()); | 31 | + printf("\nadd file:%s ,after the last file, %s", info.name.c_str(), _info[_info.size() - 2].name.c_str()); |
| 32 | } | 32 | } |
| 33 | } | 33 | } |
| 34 | 34 |
| @@ -1086,8 +1086,9 @@ int main(int argc, char * argv[]) | @@ -1086,8 +1086,9 @@ int main(int argc, char * argv[]) | ||
| 1086 | for (int i = 2; i < argc; i++){ | 1086 | for (int i = 2; i < argc; i++){ |
| 1087 | if (!strcmp(argv[i], "-t")){ | 1087 | if (!strcmp(argv[i], "-t")){ |
| 1088 | i++; | 1088 | i++; |
| 1089 | - if (i < argc) { | 1089 | + if (i > argc) { |
| 1090 | printf("error,should be 0,1 or 2 after -t"); | 1090 | printf("error,should be 0,1 or 2 after -t"); |
| 1091 | + return -2; | ||
| 1091 | } | 1092 | } |
| 1092 | piptype = atoi(argv[i]); | 1093 | piptype = atoi(argv[i]); |
| 1093 | } | 1094 | } |
-
请 注册 或 登录 后发表评论