Skip to content

Commit

Permalink
* Fix error message thrown from FFmpegFrameRecorder.start() not co…
Browse files Browse the repository at this point in the history
…ntaining filename (pull #1492)
  • Loading branch information
iglaweb authored Aug 17, 2020
1 parent a87c226 commit 27cfa61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

* Fix error message thrown from `FFmpegFrameRecorder.start()` not containing filename ([pull #1492](https://github.com/bytedeco/javacv/pull/1492))
* Fix `FFmpegFrameFilter.pull()` not returning audio/video frames without audio/video filtergraph ([issue #1466](https://github.com/bytedeco/javacv/issues/1466))
* Update `OpenCVFrameConverter.convertToOrgOpenCvCoreMat()` with new API to set the stride ([issue #1460](https://github.com/bytedeco/javacv/issues/1460))
* Fix memory leaks and reduce memory fragmentation in `FFmpegFrameGrabber` and `FFmpegFrameRecorder` ([issue #1366](https://github.com/bytedeco/javacv/issues/1366))
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/org/bytedeco/javacv/FFmpegFrameRecorder.java
Original file line number Diff line number Diff line change
Expand Up @@ -880,9 +880,10 @@ public synchronized void startUnsafe() throws Exception {
if (outputStream == null && (oformat.flags() & AVFMT_NOFILE) == 0) {
AVIOContext pb = new AVIOContext(null);
if ((ret = avio_open2(pb, filename, AVIO_FLAG_WRITE, null, options)) < 0) {
String errorMsg = "avio_open2 error() error " + ret + ": Could not open '" + filename + "'";
releaseUnsafe();
av_dict_free(options);
throw new Exception("avio_open2 error() error " + ret + ": Could not open '" + filename + "'");
throw new Exception(errorMsg);
}
oc.pb(pb);
}
Expand All @@ -893,9 +894,10 @@ public synchronized void startUnsafe() throws Exception {
}
/* write the stream header, if any */
if ((ret = avformat_write_header(oc.metadata(metadata), options)) < 0) {
String errorMsg = "avformat_write_header error() error " + ret + ": Could not write header to '" + filename + "'";
releaseUnsafe();
av_dict_free(options);
throw new Exception("avformat_write_header error() error " + ret + ": Could not write header to '" + filename + "'");
throw new Exception(errorMsg);
}
av_dict_free(options);

Expand Down

0 comments on commit 27cfa61

Please sign in to comment.