Changeset 4536
- Timestamp:
- Jun 18, 2013 4:08:08 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/wav_writer.c
r3664 r4536 399 399 /* Get file size. */ 400 400 status = pj_file_getpos(fport->fd, &file_size); 401 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 401 if (status != PJ_SUCCESS) { 402 pj_file_close(fport->fd); 403 return status; 404 } 402 405 403 406 /* Calculate wave fields */ … … 412 415 /* Seek to the file_len field. */ 413 416 status = pj_file_setpos(fport->fd, FILE_LEN_POS, PJ_SEEK_SET); 414 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 417 if (status != PJ_SUCCESS) { 418 pj_file_close(fport->fd); 419 return status; 420 } 415 421 416 422 /* Write file_len */ 417 423 bytes = sizeof(wave_file_len); 418 424 status = pj_file_write(fport->fd, &wave_file_len, &bytes); 419 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 425 if (status != PJ_SUCCESS) { 426 pj_file_close(fport->fd); 427 return status; 428 } 420 429 421 430 /* Write samples_len in FACT chunk */ … … 431 440 /* Seek to samples_len field. */ 432 441 status = pj_file_setpos(fport->fd, SAMPLES_LEN_POS, PJ_SEEK_SET); 433 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 442 if (status != PJ_SUCCESS) { 443 pj_file_close(fport->fd); 444 return status; 445 } 434 446 435 447 /* Write samples_len */ 436 448 bytes = sizeof(wav_samples_len); 437 449 status = pj_file_write(fport->fd, &wav_samples_len, &bytes); 438 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 450 if (status != PJ_SUCCESS) { 451 pj_file_close(fport->fd); 452 return status; 453 } 439 454 } 440 455 441 456 /* Seek to data_len field. */ 442 457 status = pj_file_setpos(fport->fd, data_len_pos, PJ_SEEK_SET); 443 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 458 if (status != PJ_SUCCESS) { 459 pj_file_close(fport->fd); 460 return status; 461 } 444 462 445 463 /* Write file_len */ 446 464 bytes = sizeof(wave_data_len); 447 465 status = pj_file_write(fport->fd, &wave_data_len, &bytes); 448 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 466 if (status != PJ_SUCCESS) { 467 pj_file_close(fport->fd); 468 return status; 469 } 449 470 450 471 /* Close file */ 451 472 status = pj_file_close(fport->fd); 452 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 473 if (status != PJ_SUCCESS) 474 return status; 453 475 454 476 /* Done. */
Note: See TracChangeset
for help on using the changeset viewer.