Skip to content

Commit

Permalink
Merge pull request #17 from kit-cel/exit_on_error
Browse files Browse the repository at this point in the history
add a std::runtime_error if aac enc init fails.
  • Loading branch information
MLsmd authored Aug 21, 2017
2 parents ad0e314 + c34c68c commit 0d9a43c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/mp4_encode_sb_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,14 @@ namespace gr {
GR_LOG_INFO(d_logger, "AAC enc init succeeded");
} else {
GR_LOG_ERROR(d_logger, "AAC enc init failed");
throw std::runtime_error("AAC enc init failed");
}
// check encoder status
if (aacEncInfo(d_aac_encoder, &info) != AACENC_OK) {
GR_LOG_ERROR(d_logger, "Unable to get the encoder info");
throw std::runtime_error("AAC enc init failed");
}

// set input size (number of items per channel(in this case one item is a int16_t))
d_input_size = info.frameLength;
GR_LOG_INFO(d_logger, format("AAC Encoding: framelen = %d") % info.frameLength);
Expand Down

0 comments on commit 0d9a43c

Please sign in to comment.