Commit 48477cd0 authored by Mohamed Fenjiro's avatar Mohamed Fenjiro Committed by Philippe Gorley

encoder: better error handling

Change-Id: Ic84b6e1b071e6bf1288a7f15d72cba43a9cc13ce
Reviewed-by: Philippe Gorley's avatarPhilippe Gorley <philippe.gorley@savoirfairelinux.com>
parent 8b9940eb
......@@ -327,8 +327,9 @@ void MediaEncoder::setIOContext(const std::unique_ptr<MediaIOHandle> &ioctx)
#endif
if (!(outputCtx_->oformat->flags & AVFMT_NOFILE)) {
if ((ret = avio_open(&outputCtx_->pb, filename, AVIO_FLAG_WRITE)) < 0) {
throw MediaEncoderException(
std::string("Could not set IO context" + libav_utils::getError(ret)).c_str());
std::stringstream ss;
ss << "Could not set IO context for '" << filename << "': " << libav_utils::getError(ret);
throw MediaEncoderException(ss.str().c_str());
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment