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
This commit is contained in:
@@ -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",
|
||||
|
Reference in New Issue
Block a user