Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
config: migrate DVR config to stream profiles (v13)
  • Loading branch information
perexg committed Oct 9, 2014
1 parent 2012dc8 commit ffa68ce
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/config.c
Expand Up @@ -1017,6 +1017,30 @@ config_migrate_v12 ( void )
}
}

static void
config_migrate_v13 ( void )
{
htsmsg_t *c, *e;
htsmsg_field_t *f;
int i;

if ((c = hts_settings_load("dvr/config")) != NULL) {
HTSMSG_FOREACH(f, c) {
if (!(e = htsmsg_field_get_map(f))) continue;
if (!htsmsg_get_bool(e, "container", &i)) {
htsmsg_delete_field(e, "container");
if (i == 1)
htsmsg_add_str(e, "profile", "matroska");
else if (i == 4)
htsmsg_add_str(e, "profile", "pass");
}
htsmsg_delete_field(e, "rewrite-pat");
htsmsg_delete_field(e, "rewrite-pmt");
hts_settings_save(e, "dvr/config/%s", f->hmf_name);
}
}
}

/*
* Perform backup
*/
Expand Down Expand Up @@ -1117,7 +1141,8 @@ static const config_migrate_t config_migrate_table[] = {
config_migrate_v9,
config_migrate_v10,
config_migrate_v11,
config_migrate_v12
config_migrate_v12,
config_migrate_v13
};

/*
Expand Down

0 comments on commit ffa68ce

Please sign in to comment.