also parse user private ES streams, handle REGISTRATION_DESCRIPTOR for ac3
authorFelix Domke <tmbinc@elitedvb.net>
Tue, 3 Jun 2008 13:26:16 +0000 (13:26 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Tue, 3 Jun 2008 13:26:16 +0000 (13:26 +0000)
lib/dvb/pmt.cpp

index f6f33b52da7f09c81d1befe977208f2a79536af4..555ffa79cebc11776b6c82c7551fbc24d483474e 100644 (file)
@@ -231,6 +231,7 @@ int eDVBServicePMTHandler::getProgramInfo(struct program &program)
                                                }
                                                //break; fall through !!!
                                        case 0x06: // PES Private
+                                       case 0x81: // user private
                                                        /* PES private can contain AC-3, DTS or lots of other stuff.
                                                           check descriptors to get the exact type. */
                                                for (DescriptorConstIterator desc = (*es)->getDescriptors()->begin();
@@ -313,6 +314,25 @@ int eDVBServicePMTHandler::getProgramInfo(struct program &program)
                                                                program.caids.insert(descr->getCaSystemId());
                                                                break;
                                                        }
+                                                       case REGISTRATION_DESCRIPTOR: /* some services don't have a separate AC3 descriptor */
+                                                       {
+                                                                       /* libdvbsi++ doesn't yet support this descriptor type, so work around. */
+                                                               if ((*desc)->getLength() != 4)
+                                                                       break;
+                                                               unsigned char descr[6];
+                                                               (*desc)->writeToBuffer(descr);
+                                                               int format_identifier = (descr[2] << 24) | (descr[3] << 16) | (descr[4] << 8) | (descr[5]);
+                                                               switch (format_identifier)
+                                                               {
+                                                               case 0x41432d33:
+                                                                       isaudio = 1;
+                                                                       audio.type = audioStream::atAC3;
+                                                                       break;
+                                                               default:
+                                                                       break;
+                                                               }
+                                                               break;
+                                                       }
                                                        }
                                                }
                                                break;