1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed handling QUERY

This commit is contained in:
Klaus Schmidinger 2009-08-16 13:21:07 +02:00
parent 99468a776d
commit be3ea31119

11
ci.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: ci.c 2.2 2009/08/15 11:16:27 kls Exp $ * $Id: ci.c 2.3 2009/08/16 13:21:07 kls Exp $
*/ */
#include "ci.h" #include "ci.h"
@ -610,7 +610,8 @@ cCiCaPmt::cCiCaPmt(uint8_t CmdId, int Source, int Transponder, int ProgramNumber
capmt[length++] = 0x01; // version_number, current_next_indicator - apparently vn doesn't matter, but cni must be 1 capmt[length++] = 0x01; // version_number, current_next_indicator - apparently vn doesn't matter, but cni must be 1
esInfoLengthPos = length; esInfoLengthPos = length;
capmt[length++] = 0x00; // program_info_length H (at program level) capmt[length++] = 0x00; // program_info_length H (at program level)
capmt[length++] = 0x00; // program_info_length L capmt[length++] = 0x01; // program_info_length L
capmt[length++] = cmdId;
if (caDescriptorsLength > 0) if (caDescriptorsLength > 0)
AddCaDescriptors(caDescriptorsLength, caDescriptors); AddCaDescriptors(caDescriptorsLength, caDescriptors);
} }
@ -631,7 +632,8 @@ void cCiCaPmt::AddPid(int Pid, uint8_t StreamType)
capmt[length++] = Pid & 0xFF; capmt[length++] = Pid & 0xFF;
esInfoLengthPos = length; esInfoLengthPos = length;
capmt[length++] = 0x00; // ES_info_length H (at ES level) capmt[length++] = 0x00; // ES_info_length H (at ES level)
capmt[length++] = 0x00; // ES_info_length L capmt[length++] = 0x01; // ES_info_length L
capmt[length++] = cmdId;
if (caDescriptorsLength > 0) if (caDescriptorsLength > 0)
AddCaDescriptors(caDescriptorsLength, caDescriptors); AddCaDescriptors(caDescriptorsLength, caDescriptors);
} }
@ -640,8 +642,7 @@ void cCiCaPmt::AddPid(int Pid, uint8_t StreamType)
void cCiCaPmt::AddCaDescriptors(int Length, const uint8_t *Data) void cCiCaPmt::AddCaDescriptors(int Length, const uint8_t *Data)
{ {
if (esInfoLengthPos) { if (esInfoLengthPos) {
if (length + Length < int(sizeof(capmt))) { if (length + Length <= int(sizeof(capmt))) {
capmt[length++] = cmdId;
memcpy(capmt + length, Data, Length); memcpy(capmt + length, Data, Length);
length += Length; length += Length;
int l = length - esInfoLengthPos - 2; int l = length - esInfoLengthPos - 2;