Bladeren bron

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
Palana 10 jaren geleden
bovenliggende
commit
38c9c38b9f
1 gewijzigde bestanden met toevoegingen van 8 en 0 verwijderingen
  1. 8 0
      plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c

+ 8 - 0
plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c

@@ -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",