sergey-dryabzhinsky / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
1.02k stars 216 forks source link

DASH: Nested dirs get reaped for streams still publishing #115

Closed heftig closed 8 years ago

heftig commented 8 years ago

The Xsplit encoder with a stream delay set will delay the data after sending the Publish command.

The DASH code creates the nested dir on Publish in ngx_rtmp_dash_publishngx_rtmp_dash_ensure_directory. If the playlist length is shorter than the encoder's stream delay, the empty dir gets reaped by ngx_rtmp_dash_cleanup. Once data starts flowing, ngx_rtmp_dash_open_fragment fails to create the file due to the missing target directory.

I believe this could be fixed by either ensuring that the dir is not empty while a publish is running, or by always ensuring the directory is present (ensure_directory) in open_fragments.

sergey-dryabzhinsky commented 8 years ago

Merged.