obs-ffmpeg: Set mux output context filename

This enables e.g. the HLS muxer to output all files in the same directory, with
appropriate names
master
Palana 2015-11-23 15:28:25 +01:00
parent 5548e62162
commit 38c9c38b9f
1 changed files with 8 additions and 0 deletions

View File

@ -438,6 +438,10 @@ static inline bool ffmpeg_mux_get_extra_data(struct ffmpeg_mux *ffm)
return true;
}
#ifdef _MSC_VER
#pragma warning(disable : 4996)
#endif
static inline int open_output_file(struct ffmpeg_mux *ffm)
{
AVOutputFormat *format = ffm->output->oformat;
@ -453,6 +457,10 @@ static inline int open_output_file(struct ffmpeg_mux *ffm)
}
}
strncpy(ffm->output->filename, ffm->params.file,
sizeof(ffm->output->filename));
ffm->output->filename[sizeof(ffm->output->filename) - 1] = 0;
ret = avformat_write_header(ffm->output, NULL);
if (ret < 0) {
printf("Error opening '%s': %s",