From 20a575d24f24d99896a3de143291ba280fe86734 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 1 Oct 2011 20:30:14 +0200 Subject: [PATCH] libtriple: add cRecord::AddPid Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/1ba4e043c2238349f4a18ee9918c22b20da08367 Author: Stefan Seyfried Date: 2011-10-01 (Sat, 01 Oct 2011) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libtriple/record_td.cpp | 16 ++++++++++++++++ libtriple/record_td.h | 1 + 2 files changed, 17 insertions(+) diff --git a/libtriple/record_td.cpp b/libtriple/record_td.cpp index b5261b9..ef2229b 100644 --- a/libtriple/record_td.cpp +++ b/libtriple/record_td.cpp @@ -158,6 +158,22 @@ bool cRecord::ChangePids(unsigned short /*vpid*/, unsigned short *apids, int num return true; } +bool cRecord::AddPid(unsigned short pid) +{ + std::vector pids; + INFO("\n"); + if (!dmx) { + INFO("DMX = NULL\n"); + return false; + } + pids = dmx->getPesPids(); + for (std::vector::const_iterator i = pids.begin(); i != pids.end(); ++i) { + if ((*i).pid == pid) + return true; /* or is it an error to try to add the same PID twice? */ + } + return dmx->addPid(pid); +} + void cRecord::RecordThread() { INFO("begin\n"); diff --git a/libtriple/record_td.h b/libtriple/record_td.h index 0de722d..75099f7 100644 --- a/libtriple/record_td.h +++ b/libtriple/record_td.h @@ -28,6 +28,7 @@ class cRecord bool Open(); bool Start(int fd, unsigned short vpid, unsigned short *apids, int numapids); bool Stop(void); + bool AddPid(unsigned short pid); bool ChangePids(unsigned short vpid, unsigned short *apids, int numapids); void RecordThread();