1
0
Fork 0

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:
Hendrik Leppkes 2012-03-29 15:08:13 +02:00
parent 7e07a38fe8
commit 98247d2d82
Signed by: hendrik
GPG Key ID: 846079A4B0A7C1B5
2 changed files with 28 additions and 0 deletions

View File

@ -3381,6 +3381,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 */

View File

@ -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 */