Fix for NULL output filename.

If no -o is suppled with stdin/network etc, the output name generated
was NULL, leading to creation of files like `.srt` which were in
category of hidden files.
This commit is contained in:
Saurabh Shrivastava 2017-02-06 03:09:55 +05:30
parent 851894dceb
commit 5ce5dc7fae

View File

@ -817,6 +817,11 @@ static int init_output_ctx(struct encoder_ctx *ctx, struct encoder_cfg *cfg)
basefilename = get_basename(ctx->first_input_file);
extension = get_file_extension(cfg->write_format);
if (basefilename == NULL)
{
basefilename = get_basename("utitled");
}
if (cfg->extract == 12)
{
ret = init_write(&ctx->out[0], create_outfilename(basefilename, "_1", extension), cfg->with_semaphore);