mirror of
https://github.com/livepeer/lpms
synced 2026-04-23 00:07:25 +08:00
55d1b5d5f8
Due to my omission the previous solution was going against the grain of upcoming refactoring changes in lpms_transcode(). Basically the idea is to have streamlined transcoder init() code so that changes such as Low Latency can be implemented easily in one place, instead of being distributed in many flows. Besides, adding yet another "mode" to lpms_transcode() is not really needed. The transcoder is kinda like any other object instance - it retains its status between the lpms_transcode() calls. So I think it is easier to add extra operations (such as lpms_transcode_reopen_demux() introduced here) to change said state, instead of increase the complexity of lpms_transcode() call. And finally, perhaps most important thing: Changes like these are needed because LPMS doesn't really chave good handling of changing configuration (in this case we are talking about changing from container stream without audio to the one with audio). It kind of pretends of doing so, and will handle certain small differences kinda ok, but it is very easy to come up with situation that will break it completely. Ideally, I'd like to change that by reducing transient state to the minimum (such as certain number of hardware buffers for decoding and encoding) and really re-initialize everything else that can be reinitialized cheaply. This however requires low level hardware codec programming, it is not possible to do that from ffmpeg level.