Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
DVR: handle properly subtitle update and coding fixes
  • Loading branch information
perexg committed May 29, 2015
1 parent 9bfa684 commit ec2dea3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
10 changes: 6 additions & 4 deletions src/dvr/dvr.h
Expand Up @@ -438,7 +438,8 @@ dvr_entry_t *
dvr_entry_create_htsp( const char *dvr_config_uuid,
channel_t *ch, time_t start, time_t stop,
time_t start_extra, time_t stop_extra,
const char *title, const char* subtitle, const char *description,
const char *title, const char *subtitle,
const char *description,
const char *lang, epg_genre_t *content_type,
const char *owner, const char *creator,
dvr_autorec_entry_t *dae,
Expand All @@ -447,9 +448,10 @@ dvr_entry_create_htsp( const char *dvr_config_uuid,

dvr_entry_t *
dvr_entry_update( dvr_entry_t *de,
const char* de_title, const char* de_subtitle, const char *de_desc, const char *lang,
time_t de_start, time_t de_stop,
time_t de_start_extra, time_t de_stop_extra,
const char *title, const char *subtitle,
const char *desc, const char *lang,
time_t start, time_t stop,
time_t start_extra, time_t stop_extra,
dvr_prio_t pri, int retention );

void dvr_destroy_by_channel(channel_t *ch, int delconf);
Expand Down
29 changes: 17 additions & 12 deletions src/dvr/dvr_db.c
Expand Up @@ -933,9 +933,9 @@ dvr_timer_expire(void *aux)
}

static dvr_entry_t *_dvr_entry_update
( dvr_entry_t *de, epg_broadcast_t *e, const char *title, const char* subtitle,
( dvr_entry_t *de, epg_broadcast_t *e, const char *title, const char *subtitle,
const char *desc, const char *lang, time_t start, time_t stop,
time_t start_extra, time_t stop_extra, dvr_prio_t pri, int retention )
time_t start_extra, time_t stop_extra, dvr_prio_t pri, int retention )
{
char buf[40];
int save = 0, updated = 0;
Expand Down Expand Up @@ -1003,7 +1003,11 @@ static dvr_entry_t *_dvr_entry_update
}

/* Subtitle*/
if (subtitle) {
if (e && e->episode && e->episode->subtitle) {
if (de->de_subtitle) lang_str_destroy(de->de_subtitle);
de->de_subtitle = lang_str_copy(e->episode->subtitle);
save = 1;
} else if (subtitle) {
if (!de->de_subtitle) de->de_subtitle = lang_str_create();
save = lang_str_add(de->de_subtitle, subtitle, lang, 1);
}
Expand All @@ -1029,7 +1033,7 @@ static dvr_entry_t *_dvr_entry_update
de->de_desc = lang_str_copy(e->episode->summary);
} else if (desc) {
if (!de->de_desc) de->de_desc = lang_str_create();
save = lang_str_add(de->de_desc, title, lang, 1);
save = lang_str_add(de->de_desc, desc, lang, 1);
}

/* Genre */
Expand Down Expand Up @@ -1074,14 +1078,15 @@ static dvr_entry_t *_dvr_entry_update
*/
dvr_entry_t *
dvr_entry_update
(dvr_entry_t *de,
const char* de_title, const char* de_subtitle, const char *de_desc, const char *lang,
time_t de_start, time_t de_stop,
time_t de_start_extra, time_t de_stop_extra,
dvr_prio_t pri, int retention)
{
return _dvr_entry_update(de, NULL, de_title, de_subtitle, de_desc, lang,
de_start, de_stop, de_start_extra, de_stop_extra,
( dvr_entry_t *de,
const char *title, const char *subtitle,
const char *desc, const char *lang,
time_t start, time_t stop,
time_t start_extra, time_t stop_extra,
dvr_prio_t pri, int retention )
{
return _dvr_entry_update(de, NULL, title, subtitle, desc, lang,
start, stop, start_extra, stop_extra,
pri, retention);
}

Expand Down

1 comment on commit ec2dea3

@ksooo
Copy link
Contributor

@ksooo ksooo commented on ec2dea3 May 29, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please merge this fix for 4.0?

Please sign in to comment.