From 8fc486339c4a21d3e2c565c9a0eb5a7383386d44 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Thu, 18 Jan 2018 05:34:26 -0800 Subject: [PATCH] obs-ffmpeg: Add proc to get last replay buffer Allows getting the path of the last replay buffer saved via the procedure handler of the FFmpeg muxer output. --- plugins/obs-ffmpeg/obs-ffmpeg-mux.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-mux.c b/plugins/obs-ffmpeg/obs-ffmpeg-mux.c index 0e2d076c3..9cd5417d8 100644 --- a/plugins/obs-ffmpeg/obs-ffmpeg-mux.c +++ b/plugins/obs-ffmpeg/obs-ffmpeg-mux.c @@ -531,6 +531,12 @@ static void save_replay_proc(void *data, calldata_t *cd) UNUSED_PARAMETER(cd); } +static void get_last_replay(void *data, calldata_t *cd) +{ + struct ffmpeg_muxer *stream = data; + calldata_set_string(cd, "path", stream->path.array); +} + static void *replay_buffer_create(obs_data_t *settings, obs_output_t *output) { UNUSED_PARAMETER(settings); @@ -544,6 +550,8 @@ static void *replay_buffer_create(obs_data_t *settings, obs_output_t *output) proc_handler_t *ph = obs_output_get_proc_handler(output); proc_handler_add(ph, "void save()", save_replay_proc, stream); + proc_handler_add(ph, "void get_last_replay(out string path)", + get_last_replay, stream); return stream; }