HACK: Add a function to manually add streams to the MPEG-TS demuxer
This is used by the BDMV demuxer when some streams are not detected by auto-probing
This commit is contained in:
parent
430e70fa38
commit
73edaa302d
@ -3380,6 +3380,32 @@ static int64_t mpegts_get_dts(AVFormatContext *s, int stream_index,
|
||||
return AV_NOPTS_VALUE;
|
||||
}
|
||||
|
||||
int avpriv_mpegts_add_stream(AVFormatContext *s, int pid, uint32_t stream_type, int program)
|
||||
{
|
||||
MpegTSContext *ts = s->priv_data;
|
||||
MpegTSFilter *tss = ts->pids[pid];
|
||||
PESContext *pes = NULL;
|
||||
AVStream *st = NULL;
|
||||
|
||||
if (tss)
|
||||
return -1;
|
||||
|
||||
pes = add_pes_stream(ts, pid, -1);
|
||||
if (!pes)
|
||||
return -1;
|
||||
|
||||
st = avformat_new_stream(pes->stream, NULL);
|
||||
st->id = pes->pid;
|
||||
|
||||
if (!st)
|
||||
return -1;
|
||||
|
||||
mpegts_set_stream_info(st, pes, stream_type, AV_RL32("HDMV"));
|
||||
if (program >= 0)
|
||||
av_program_add_stream_index(s, program, st->index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**************************************************************/
|
||||
/* parsing functions - called from other demuxers such as RTP */
|
||||
|
||||
|
@ -232,4 +232,6 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
|
||||
*/
|
||||
int ff_check_h264_startcode(AVFormatContext *s, const AVStream *st, const AVPacket *pkt);
|
||||
|
||||
int avpriv_mpegts_add_stream(AVFormatContext *s, int pid, uint32_t stream_type, int program);
|
||||
|
||||
#endif /* AVFORMAT_MPEGTS_H */
|
||||
|
Loading…
Reference in New Issue
Block a user