summaryrefslogtreecommitdiff
path: root/p2pvr/dvb/siParsers/programAssociation.cpp
blob: 7839b9ebf2506751ffc9a1ea664df8174840f468 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <pch.hpp>
#include "programAssociation.h"

struct ProgramAssociation {
	uint16_t program_number;
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
	uint8_t reserved : 3;
	uint8_t pid_hi : 5;
#else
	uint8_t pid_hi : 5;
	uint8_t reserved : 3;
#endif
	uint8_t pid_lo;
};

bool
SiProgramAssociationParser::CheckTableId(u_char tableId) const
{
	return (tableId == 0x00);
}

void
SiProgramAssociationParser::ParseSiTable(const ProgramAssociationSection * pas, ProgramAssociationMapPtr pam)
{
	LoopOverSection<ProgramAssociation>(pas->data, HILO(pas->header.section_length) - 12, [this,pam](const ProgramAssociation * sd) {
			(*pam)[ntohs(sd->program_number)] = HILO(sd->pid);
		});
}