TT#14008 add %l format to output file names

closes #1269

Change-Id: I48a8ee1dde569ee86e23e9afd90e77ba60cb2598
pull/1346/head
Richard Fuchs 5 years ago
parent 99fbff408e
commit d116b44cf2

@ -73,7 +73,7 @@ static void meta_stream_interface(metafile_t *mf, unsigned long snum, char *cont
if (output_enabled && output_mixed) {
pthread_mutex_lock(&mf->mix_lock);
if (!mf->mix) {
mf->mix_out = output_new(output_dir, mf->parent, "mix");
mf->mix_out = output_new(output_dir, mf->parent, "mix", "mix");
if (mix_method == MM_CHANNELS)
mf->mix_out->channel_mult = MIX_NUM_INPUTS;
mf->mix = mix_new();

@ -95,7 +95,7 @@ static output_t *output_alloc(const char *path, const char *name) {
return ret;
}
output_t *output_new(const char *path, const char *call, const char *type) {
output_t *output_new(const char *path, const char *call, const char *type, const char *label) {
// construct output file name
struct timeval now;
struct tm tm;
@ -124,6 +124,9 @@ output_t *output_new(const char *path, const char *call, const char *type) {
case 't':
g_string_append(f, type);
break;
case 'l':
g_string_append(f, label);
break;
case 'Y':
g_string_append_printf(f, "%04i", tm.tm_year + 1900);
break;

@ -10,7 +10,7 @@ extern int mp3_bitrate;
void output_init(const char *format);
output_t *output_new(const char *path, const char *call, const char *type);
output_t *output_new(const char *path, const char *call, const char *type, const char *label);
output_t *output_new_from_full_path(const char *path, char *name);
void output_close(output_t *);

@ -16,6 +16,7 @@
#include "db.h"
#include "streambuf.h"
#include "resample.h"
#include "tag.h"
static ssize_t ssrc_tls_write(void *, const void *, size_t);
@ -194,7 +195,8 @@ out:
else {
char buf[16];
snprintf(buf, sizeof(buf), "%08lx", ssrc);
ret->output = output_new(output_dir, mf->parent, buf);
tag_t *tag = tag_get(mf, stream->tag);
ret->output = output_new(output_dir, mf->parent, buf, tag->label);
}
db_do_stream(mf, ret->output, "single", stream, ssrc);
}

@ -166,6 +166,11 @@ The stream type. For B<single> streams this is the SSRC written as hexadecimal;
for B<mix> stream this is the string B<mix>. It is mandatory for the output
pattern to include this format sequence.
=item B<%l>
The label for the participating party as communicated from the controlling
daemon.
=item B<%Y>
=item B<%m>

Loading…
Cancel
Save