int codec; /* HB worker object id of codec */
int codec_param; /* param for codec (usually ffmpeg codec id) */
const char* name; /* description of type */
+ int extra_hdr; /* needs a substream header added to PS pack */
} stream2codec_t;
#define st(id, kind, codec, codec_param, name) \
- [id] = { kind, codec, codec_param, name }
+ [id] = { kind, codec, codec_param, name, 0 }
+#define se(id, kind, codec, codec_param, name) \
+ [id] = { kind, codec, codec_param, name, 1 }
static const stream2codec_t st2codec[256] = {
st(0x01, V, WORK_DECMPEG2, 0, "MPEG1"),
st(0x1b, V, WORK_DECAVCODECV, CODEC_ID_H264, "H.264"),
st(0x80, U, 0, 0, "DigiCipher II Video"),
- st(0x81, A, HB_ACODEC_AC3, 0, "AC-3"),
- st(0x82, A, HB_ACODEC_MPGA, CODEC_ID_DTS, "HDMV DTS"),
+ se(0x81, A, HB_ACODEC_AC3, 0, "AC-3"),
+ se(0x82, A, HB_ACODEC_DCA, 0, "HDMV DTS"),
st(0x83, A, HB_ACODEC_LPCM, 0, "LPCM"),
st(0x84, A, 0, 0, "SDDS"),
st(0x85, U, 0, 0, "ATSC Program ID"),
st(0x86, U, 0, 0, "SCTE 35 splice info"),
st(0x87, A, 0, 0, "E-AC-3"),
- st(0x8a, A, HB_ACODEC_DCA, 0, "DTS"),
+ se(0x8a, A, HB_ACODEC_DCA, 0, "DTS"),
- st(0x91, A, HB_ACODEC_AC3, 0, "AC-3"),
+ se(0x91, A, HB_ACODEC_AC3, 0, "AC-3"),
st(0x92, U, 0, 0, "Subtitle"),
st(0x94, A, 0, 0, "SDDS"),
uint8_t ts_streamid[kMaxNumberDecodeStreams];
uint8_t ts_stream_type[kMaxNumberDecodeStreams];
+ uint8_t ts_extra_hdr[kMaxNumberDecodeStreams];
char *path;
FILE *file_handle;
{
stream->ts_audio_pids[indx] = stream->ts_audio_pids[i];
stream->ts_stream_type[1 + indx] = stream->ts_stream_type[1+i];
+ stream->ts_extra_hdr[1 + indx] = stream->ts_extra_hdr[1+i];
stream->ts_streamid[1 + indx] = stream->ts_streamid[1 + i];
++indx;
}
if ( st2codec[stype].kind == A && st2codec[stype].codec )
{
stream->ts_streamid[1 + aud_pid_index] = audio->id;
+ stream->ts_extra_hdr[1 + aud_pid_index] = st2codec[stype].extra_hdr;
audio->config.in.codec = st2codec[stype].codec;
audio->config.in.codec_param = st2codec[stype].codec_param;
set_audio_description( audio,
// we always ship a PACK header plus all the data in our demux buf.
// AC3 audio also always needs its substream header.
len = 14 + stream->ts_pos[curstream];
- if ( stream->ts_stream_type[curstream] == 0x81)
+ if ( stream->ts_extra_hdr[curstream] )
{
len += 4;
}
tdat[3] = stream->ts_streamid[curstream];
uint16_t plen = stream->ts_pos[curstream] - 6;
- if ( stream->ts_stream_type[curstream] == 0x81)
+ if ( stream->ts_extra_hdr[curstream] )
{
// We have to add an AC3 header in front of the data. Add its
// size to the PES packet length.
{
// data without a PES start header needs a simple 'continuation'
// PES header. AC3 audio also needs its substream header.
- if ( stream->ts_stream_type[curstream] != 0x81)
+ if ( stream->ts_extra_hdr[curstream] == 0 )
{
make_pes_header(stream, stream->ts_pos[curstream],
stream->ts_streamid[curstream]);