1 #include "newpacket.hpp"
9 int real_main(int argc
, char** argv
)
12 std::cerr
<< "syntax: demuxdump.exe <input> <channel> <output>" << std::endl
;
16 read_channel
rchan(argv
[1]);
17 uint32_t pchan
= rchan
.number_for_channel(argv
[2]);
18 write_channel
wchan(argv
[3]);
21 bool segtable_present
= false;
22 uint16_t lasttype
= 65535;
23 uint64_t lasttime
= 0;
24 while((p
= rchan
.read())) {
25 lasttime
= p
->rp_timestamp
;
26 if(p
->rp_channel_perm
== pchan
) {
27 if(!segtable_present
|| lasttype
!= p
->rp_major
) {
28 std::vector
<struct channel
> channels
;
30 channels
[0].c_channel
= 0;
31 channels
[0].c_type
= lasttype
= p
->rp_major
;
32 channels
[0].c_channel_name
= p
->rp_channel_name
;
33 channels
[1].c_channel
= 1;
34 channels
[1].c_type
= 3;
35 channels
[1].c_channel_name
= "<DUMMY>";
36 wchan
.start_segment(channels
);
37 segtable_present
= true;
46 p2
.rp_timestamp
= lasttime
;