diff -ruN mythtv-0.24.1+fixes.20111005.c8c1582//mythtv/libs/libmythtv/firewirerecorder.cpp mythtv-0.24.1+fixes.20111005.c8c1582-asp1//mythtv/libs/libmythtv/firewirerecorder.cpp
|
old
|
new
|
|
| 31 | 31 | if (!isopen) |
| 32 | 32 | isopen = channel->GetFirewireDevice()->OpenPort(); |
| 33 | 33 | |
| | 34 | memset(_stream_id, 0, sizeof(_stream_id)); |
| | 35 | |
| 34 | 36 | return isopen; |
| 35 | 37 | } |
| 36 | 38 | |
| … |
… |
|
| 140 | 142 | // Pass or reject packets based on PID, and parse info from them |
| 141 | 143 | if (lpid == GetStreamData()->VideoPIDSingleProgram()) |
| 142 | 144 | { |
| 143 | | _buffer_packets = !FindMPEG2Keyframes(&tspacket); |
| | 145 | uint streamType = _stream_id[tspacket.PID()]; |
| | 146 | |
| | 147 | // Check for keyframes and count frames |
| | 148 | if (streamType == StreamID::H264Video) |
| | 149 | { |
| | 150 | _buffer_packets = !FindH264Keyframes(&tspacket); |
| | 151 | if (!_seen_sps) |
| | 152 | return; |
| | 153 | } |
| | 154 | else |
| | 155 | { |
| | 156 | _buffer_packets = !FindMPEG2Keyframes(&tspacket); |
| | 157 | } |
| 144 | 158 | BufferedWrite(tspacket); |
| 145 | 159 | } |
| 146 | 160 | else if (GetStreamData()->IsAudioPID(lpid)) |
| … |
… |
|
| 216 | 230 | if (!pmt) |
| 217 | 231 | return; |
| 218 | 232 | |
| | 233 | // collect stream types for H.264 (MPEG-4 AVC) keyframe detection |
| | 234 | for (uint i = 0; i < pmt->StreamCount(); i++) |
| | 235 | _stream_id[pmt->StreamPID(i)] = pmt->StreamType(i); |
| | 236 | |
| 219 | 237 | int next = (pmt->tsheader()->ContinuityCounter()+1)&0xf; |
| 220 | 238 | pmt->tsheader()->SetContinuityCounter(next); |
| 221 | 239 | BufferedWrite(*(reinterpret_cast<const TSPacket*>(pmt->tsheader()))); |
diff -ruN mythtv-0.24.1+fixes.20111005.c8c1582//mythtv/libs/libmythtv/firewirerecorder.h mythtv-0.24.1+fixes.20111005.c8c1582-asp1//mythtv/libs/libmythtv/firewirerecorder.h
|
old
|
new
|
|
| 63 | 63 | FirewireChannel *channel; |
| 64 | 64 | bool isopen; |
| 65 | 65 | vector<unsigned char> buffer; |
| | 66 | |
| | 67 | unsigned char _stream_id[0x1fff + 1]; |
| 66 | 68 | }; |
| 67 | 69 | |
| 68 | 70 | #endif // _FIREWIRERECORDER_H_ |