diff --git a/src/dvr/dvr_rec.c b/src/dvr/dvr_rec.c index 051836fa..ec777996 100644 --- a/src/dvr/dvr_rec.c +++ b/src/dvr/dvr_rec.c @@ -326,17 +326,49 @@ dvr_rec_start(dvr_entry_t *de, const streaming_start_t *ss) si->si_service ?: ""); + tvhlog(LOG_INFO, "dvr", + " # %-20s %-4s %-16s %-10s %-10s", + "type", + "lang", + "resolution", + "samplerate", + "channels"); + for(i = 0; i < ss->ss_num_components; i++) { ssc = &ss->ss_components[i]; + char res[16]; + char sr[6]; + char ch[7]; + + if(SCT_ISAUDIO(ssc->ssc_type)) { + snprintf(sr, sizeof(sr), "%d", sri_to_rate(ssc->ssc_sri)); + + if(ssc->ssc_channels == 6) + snprintf(ch, sizeof(ch), "5.1"); + else + snprintf(ch, sizeof(ch), "%d", ssc->ssc_channels); + } else { + sr[0] = 0; + ch[0] = 0; + } + + + if(SCT_ISVIDEO(ssc->ssc_type)) { + snprintf(res, sizeof(res), "%d x %d", + ssc->ssc_width, ssc->ssc_height); + } else { + res[0] = 0; + } + tvhlog(LOG_INFO, "dvr", - "%2d %-20s %-4s %5d x %-5d %-5d", + "%2d %-20s %-4s %-16s %-10s %-10s", ssc->ssc_index, streaming_component_type2txt(ssc->ssc_type), ssc->ssc_lang, - ssc->ssc_width, - ssc->ssc_height, - ssc->ssc_frameduration); + res, + sr, + ch); } } diff --git a/src/plumbing/globalheaders.c b/src/plumbing/globalheaders.c index 268cb7a2..e4ac610f 100644 --- a/src/plumbing/globalheaders.c +++ b/src/plumbing/globalheaders.c @@ -60,6 +60,11 @@ apply_header(streaming_start_component_t *ssc, th_pkt_t *pkt) if(ssc->ssc_frameduration == 0 && pkt->pkt_duration != 0) ssc->ssc_frameduration = pkt->pkt_duration; + if(SCT_ISAUDIO(ssc->ssc_type) && !ssc->ssc_channels && !ssc->ssc_sri) { + ssc->ssc_channels = pkt->pkt_channels; + ssc->ssc_sri = pkt->pkt_sri; + } + if(ssc->ssc_gh != NULL) return; @@ -104,6 +109,10 @@ headers_complete(globalheaders_t *gh) if((SCT_ISAUDIO(ssc->ssc_type) || SCT_ISVIDEO(ssc->ssc_type)) && ssc->ssc_frameduration == 0) return 0; + + if(SCT_ISAUDIO(ssc->ssc_type) && + (ssc->ssc_sri == 0 || ssc->ssc_channels == 0)) + return 0; if(ssc->ssc_gh == NULL && (ssc->ssc_type == SCT_H264 || diff --git a/src/streaming.h b/src/streaming.h index c13b5318..ad4669b4 100644 --- a/src/streaming.h +++ b/src/streaming.h @@ -32,6 +32,8 @@ typedef struct streaming_start_component { uint16_t ssc_ancillary_id; int16_t ssc_width; int16_t ssc_height; + uint8_t ssc_sri; + uint8_t ssc_channels; pktbuf_t *ssc_gh;