sourcey / libsourcey

C++14 evented IO libraries for high performance networking and media based applications
https://sourcey.com/libsourcey
GNU Lesser General Public License v2.1
1.31k stars 347 forks source link

Fix logic error when calling _encoder.init() #230

Closed R-Gerard closed 6 years ago

R-Gerard commented 6 years ago

Currently StreamRecorder never calls _encoder.init() when recording both video and audio tracks. Specifically, StreamRecorder expects one of the booleans to be true and the other to be false exactly once so that it can call the init function, however in my observations both values start as true then both flip to false.

This PR separates out the init logic from _awaitingVideo and _awaitingAudio to call init exactly once.

auscaster commented 6 years ago

Looks good, thanks for the contribution! :+1: