libtriple: improve audio stream handling in cPlayback()

use a c++ map instead of arrays to store audio stream data
Side effect: audio streams as returned by findAllPids() are now
sorted by pid, helping default selection for MPEG and VDR streams
This commit is contained in:
Stefan Seyfried
2011-05-15 12:32:01 +02:00
parent 8d7c705587
commit 9222f4d5dc
2 changed files with 44 additions and 63 deletions

View File

@@ -3,6 +3,7 @@
#include <inttypes.h>
#include <string>
#include <map>
#include <vector>
/* almost 256kB */
@@ -70,10 +71,12 @@ class cPlayback
uint16_t vpid;
uint16_t apid;
bool ac3;
uint16_t apids[10];
unsigned short ac3flags[10];
std::string alang[10];
uint16_t numpida;
struct AStream {
// uint16_t pid;
bool ac3;
std::string lang; /* not yet really used */
};
std::map<uint16_t, AStream> astreams; /* stores AStream sorted by pid */
int64_t pts_start;
int64_t pts_end;