Skip to content

Commit

Permalink
Use -O2 for mp4 build
Browse files Browse the repository at this point in the history
Seems like a bug in optimizer.
Size is about the same for both -O2 and -O3. Hope performance is also similar.
  • Loading branch information
Kagami committed Apr 17, 2020
1 parent 913f48b commit 330381a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ ffmpeg-worker-webm.js: $(FFMPEG_WEBM_BC) $(PRE_JS) $(POST_JS_WORKER)
ffmpeg-mp4.js: $(FFMPEG_MP4_BC) $(PRE_JS) $(POST_JS_SYNC)
emcc $(FFMPEG_MP4_BC) $(MP4_SHARED_DEPS) \
--post-js $(POST_JS_SYNC) \
$(EMCC_COMMON_ARGS)
$(EMCC_COMMON_ARGS) -O2

ffmpeg-worker-mp4.js: $(FFMPEG_MP4_BC) $(PRE_JS) $(POST_JS_WORKER)
emcc $(FFMPEG_MP4_BC) $(MP4_SHARED_DEPS) \
--post-js $(POST_JS_WORKER) \
$(EMCC_COMMON_ARGS)
$(EMCC_COMMON_ARGS) -O2
2 changes: 1 addition & 1 deletion build/post-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var __ffmpegjs_running = false;

// Shim for nodejs
if (typeof self === "undefined") {
self = require("worker_threads").parentPort;
self = require("worker_threads")["parentPort"];
}

self.onmessage = function(e) {
Expand Down
8 changes: 4 additions & 4 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ describe("WebM", function() {
expect(res.MEMFS[0].data.length).to.equal(0);
});

it.skip("should have subtitles filter", function() {
/*it("should have subtitles filter", function() {
var code;
var res = ffmpeg_webm({
arguments: [
Expand All @@ -230,7 +230,7 @@ describe("WebM", function() {
MEMFS: [{name: "test.webm", data: testData}],
});
expect(code).to.equal(0);
});
});*/

it("should have Ogg muxer", function() {
var res = ffmpeg_webm({
Expand All @@ -252,7 +252,7 @@ describe("WebM", function() {
expect(file.data).to.be.an.instanceof(Uint8Array);
});

it.skip("should encode sequence of frames to WebM", function() {
/*it("should encode sequence of frames to WebM", function() {
var res = ffmpeg_webm({
// FIXME(Kagami): pattern_type=sequence doesn't work with NODEFS
// for some reason.
Expand All @@ -269,7 +269,7 @@ describe("WebM", function() {
var file = res.MEMFS[0];
expect(file.name).to.equal("out.webm");
expect(file.data.length).to.be.above(0);
});
});*/
});

describe("Worker", function() {
Expand Down

0 comments on commit 330381a

Please sign in to comment.