OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 return (0); | 443 return (0); |
444 } | 444 } |
445 | 445 |
446 FILE* in_file = fopen(argv[1], "rb"); | 446 FILE* in_file = fopen(argv[1], "rb"); |
447 CHECK_NOT_NULL(in_file); | 447 CHECK_NOT_NULL(in_file); |
448 printf("Input file: %s\n", argv[1]); | 448 printf("Input file: %s\n", argv[1]); |
449 FILE* out_file = fopen(argv[2], "wb"); | 449 FILE* out_file = fopen(argv[2], "wb"); |
450 CHECK_NOT_NULL(out_file); | 450 CHECK_NOT_NULL(out_file); |
451 printf("Output file: %s\n\n", argv[2]); | 451 printf("Output file: %s\n\n", argv[2]); |
452 packet_size = atoi(argv[3]); | 452 packet_size = atoi(argv[3]); |
453 CHECK_NOT_NULL(packet_size); | 453 if (packet_size <= 0) { |
| 454 printf("Packet size %d must be positive", packet_size); |
| 455 return -1; |
| 456 } |
454 printf("Packet size: %i\n", packet_size); | 457 printf("Packet size: %i\n", packet_size); |
455 | 458 |
456 // check for stereo | 459 // check for stereo |
457 if (argv[4][strlen(argv[4]) - 1] == '*') { | 460 if (argv[4][strlen(argv[4]) - 1] == '*') { |
458 // use stereo | 461 // use stereo |
459 usingStereo = true; | 462 usingStereo = true; |
460 numChannels = 2; | 463 numChannels = 2; |
461 argv[4][strlen(argv[4]) - 1] = '\0'; | 464 argv[4][strlen(argv[4]) - 1] = '\0'; |
462 } | 465 } |
463 | 466 |
(...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1829 memmove(ptrL + stride, ptrL, ptrR - ptrL); | 1832 memmove(ptrL + stride, ptrL, ptrR - ptrL); |
1830 | 1833 |
1831 // copy from temp to left pointer | 1834 // copy from temp to left pointer |
1832 memcpy(ptrL, temp, stride); | 1835 memcpy(ptrL, temp, stride); |
1833 | 1836 |
1834 // advance pointers | 1837 // advance pointers |
1835 ptrL += stride * 2; | 1838 ptrL += stride * 2; |
1836 ptrR += stride; | 1839 ptrR += stride; |
1837 } | 1840 } |
1838 } | 1841 } |
OLD | NEW |