Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
DVR: quickfix for previous patch, fixes #2904
  • Loading branch information
perexg committed Jun 1, 2015
1 parent bc6efcf commit 164caf0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/api/api_dvr.c
Expand Up @@ -258,7 +258,7 @@ api_dvr_autorec_create
htsmsg_t *conf;
dvr_config_t *cfg;
dvr_autorec_entry_t *dae;
const char *config_uuid;
const char *s1;

if (!(conf = htsmsg_get_map(args, "conf")))
return EINVAL;
Expand All @@ -268,11 +268,14 @@ api_dvr_autorec_create
if (perm->aa_representative)
htsmsg_set_str(conf, "creator", perm->aa_representative);

config_uuid = htsmsg_get_str(conf, "config_uuid");
s1 = htsmsg_get_str(conf, "config_uuid");
if (s1 == NULL)
s1 = htsmsg_get_str(conf, "config_name");

pthread_mutex_lock(&global_lock);
cfg = dvr_config_find_by_list(perm->aa_dvrcfgs, config_uuid);
cfg = dvr_config_find_by_list(perm->aa_dvrcfgs, s1);
if (cfg) {
htsmsg_set_str(conf, "config_name", idnode_uuid_as_str(&cfg->dvr_id));
dae = dvr_autorec_create(NULL, conf);
if (dae) {
dvr_autorec_save(dae);
Expand Down
3 changes: 3 additions & 0 deletions src/input/mpegts/tsdemux.c
Expand Up @@ -94,6 +94,9 @@ ts_recv_packet0
}
st->es_cc = (cc + 1) & 0xf;
}

if (st->es_type == SCT_DVBSUB)
tvhlog_hexdump("pmt", tsb, 188);

off = tsb[3] & 0x20 ? tsb[4] + 5 : 4;

Expand Down
6 changes: 6 additions & 0 deletions src/parsers/parser_teletext.c
Expand Up @@ -708,6 +708,8 @@ extract_subtitle(mpegts_service_t *t, elementary_stream_t *st,
if ((cset = get_cset(ttm->ttm_charset[0])) == NULL)
cset = char_table[0]; /* fallback */

printf("extract subtitle: %i\n", st->es_pid);

for (i = 0; i < 23; i++) {
is_font_tag_open = 0;
current_color = 7; /* white = default */
Expand Down Expand Up @@ -797,6 +799,7 @@ extract_subtitle(mpegts_service_t *t, elementary_stream_t *st,
st->es_curpts = pts;

sub[off++] = 0;
printf("sub = '%s'\n", sub);

th_pkt_t *pkt = pkt_alloc(sub, off, pts, pts);
pkt->pkt_componentindex = st->es_index;
Expand Down Expand Up @@ -879,6 +882,7 @@ tt_decode_line(mpegts_service_t *t, elementary_stream_t *st, uint8_t *buf)

line = mpag >> 3;

printf("line = %d\n", line);
switch(line) {
case 0:
if(ttm->ttm_curpage != 0) {
Expand Down Expand Up @@ -953,6 +957,8 @@ teletext_input(mpegts_service_t *t, elementary_stream_t *st, const uint8_t *tsb)
uint8_t buf[42];

x = tsb + 4;
printf("telext input!!! %i %02x:%02x:%02x:%02x\n", st->es_pid, tsb[0], tsb[1], tsb[2], tsb[3]);
tvhlog_hexdump("bat", tsb, 188);
for(i = 0; i < 4; i++) {
if(*x == 2 || *x == 3) {
for(j = 0; j < 42; j++)
Expand Down
5 changes: 5 additions & 0 deletions src/parsers/parsers.c
Expand Up @@ -166,6 +166,8 @@ parse_mpeg_ts(service_t *t, elementary_stream_t *st, const uint8_t *data,
break;

case SCT_DVBSUB:
if (len > 0)
printf("DVBSUB data!!! %i\n", len);
parse_subtitles(t, st, data, len, start);
break;

Expand Down Expand Up @@ -1361,6 +1363,8 @@ parse_subtitles(service_t *t, elementary_stream_t *st, const uint8_t *data,
if(st->es_parser_state == 0)
return;

printf("subtitles append: %i\n", len);

sbuf_append(&st->es_buf, data, len);

if(st->es_buf.sb_ptr < 6)
Expand Down Expand Up @@ -1397,6 +1401,7 @@ parse_subtitles(service_t *t, elementary_stream_t *st, const uint8_t *data,

// end_of_PES_data_field_marker
if(buf[psize - 1] == 0xff) {
printf("subtitles sent: %i\n", psize - 1);
pkt = pkt_alloc(buf, psize - 1, st->es_curpts, st->es_curdts);
pkt->pkt_commercial = t->s_tt_commercial_advice;
pkt->pkt_err = st->es_buf.sb_err;
Expand Down

0 comments on commit 164caf0

Please sign in to comment.