fix bug: invalid data of audio file maybe used to get the max width and height of input video
正在显示
1 个修改的文件
包含
18 行增加
和
13 行删除
| @@ -685,22 +685,27 @@ void add_media_infos() | @@ -685,22 +685,27 @@ void add_media_infos() | ||
| 685 | printf("\nsorted file info:"); | 685 | printf("\nsorted file info:"); |
| 686 | it = sorted_media_with_end.begin(); | 686 | it = sorted_media_with_end.begin(); |
| 687 | for (; it != sorted_media_with_end.end();it++){ | 687 | for (; it != sorted_media_with_end.end();it++){ |
| 688 | - printf("\n%2d %8.3f %s %4d %4d %3d %s", it->sorted_index, it->type_time, it->name.c_str(), it->width, it->height, it->rotate, it->t_type == tt_start ? "start" : "end"); | ||
| 689 | - if (it->width > it->height) { | ||
| 690 | - if (width < it->width) { | ||
| 691 | - width = it->width; | 688 | + if (it->m_type == mt_video) { |
| 689 | + printf("\n%2d %8.3f %s %s %4d %4d %3d", it->sorted_index, it->type_time, it->name.c_str(), it->t_type == tt_start ? "start" : "end", it->width, it->height, it->rotate); | ||
| 690 | + if (it->width > it->height) { | ||
| 691 | + if (width < it->width) { | ||
| 692 | + width = it->width; | ||
| 693 | + } | ||
| 694 | + if (height < it->height) { | ||
| 695 | + height = it->height; | ||
| 696 | + } | ||
| 692 | } | 697 | } |
| 693 | - if (height < it->height) { | ||
| 694 | - height = it->height; | 698 | + else {//set the image to landscape |
| 699 | + if (width < it->height) { | ||
| 700 | + width = it->height; | ||
| 701 | + } | ||
| 702 | + if (height < it->width) { | ||
| 703 | + height = it->width; | ||
| 704 | + } | ||
| 695 | } | 705 | } |
| 696 | } | 706 | } |
| 697 | - else {//set the image to landscape | ||
| 698 | - if (width < it->height) { | ||
| 699 | - width = it->height; | ||
| 700 | - } | ||
| 701 | - if (height < it->width) { | ||
| 702 | - height = it->width; | ||
| 703 | - } | 707 | + else { |
| 708 | + printf("\n%2d %8.3f %s %s", it->sorted_index, it->type_time, it->name.c_str(), it->t_type == tt_start ? "start" : "end"); | ||
| 704 | } | 709 | } |
| 705 | } | 710 | } |
| 706 | printf("\n-------------------------\n"); | 711 | printf("\n-------------------------\n"); |
-
请 注册 或 登录 后发表评论