]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Include # of channels and samplerate in streaming start message produced by globalheaders
authorAndreas Öman <andreas@lonelycoder.com>
Thu, 1 Jul 2010 08:34:10 +0000 (08:34 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Thu, 1 Jul 2010 08:34:10 +0000 (08:34 +0000)
src/dvr/dvr_rec.c
src/plumbing/globalheaders.c
src/streaming.h

index 051836fa94430a3f173750124801c3213ff16e3c..ec777996ae0090fab2bc7ec8f59f0f3ee0b07ec4 100644 (file)
@@ -326,17 +326,49 @@ dvr_rec_start(dvr_entry_t *de, const streaming_start_t *ss)
         si->si_service  ?: "<N/A>");
 
 
+  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);
   }
 }
 
index 268cb7a2e94c1323bd456c617379b922a376a4c2..e4ac610f21f130d85bc0e6ceaee8a8168577b4b3 100644 (file)
@@ -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 ||
index c13b53183ec33828b636f455981f2abed34a39ae..ad4669b4305665ccd1a3b852d89c032b6a2fc6b5 100644 (file)
@@ -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;