#include "avformat.h"
#include "crc.h"
#include "mpegts.h"
+#include "allformats.h"
//#define DEBUG_SI
//#define DEBUG_SEEK
int auto_guess;
int set_service_ret;
- /** force raw MPEG2 transport stream output, if possible */
- int mpeg2ts_raw;
/** compute exact PCR for each transport stream packet */
int mpeg2ts_compute_pcr;
MpegTSService *service;
if (ap) {
- ts->mpeg2ts_raw = ap->mpeg2ts_raw;
ts->mpeg2ts_compute_pcr = ap->mpeg2ts_compute_pcr;
+ if(ap->mpeg2ts_raw){
+ av_log(s, AV_LOG_ERROR, "use mpegtsraw_demuxer!\n");
+ return -1;
+ }
}
/* read the first 1024 bytes to get packet size */
ts->auto_guess = 0;
goto_auto_guess:
- if (!ts->mpeg2ts_raw) {
+ if (s->iformat == &mpegts_demuxer) {
/* normal demux */
if (!ts->auto_guess) {
{
MpegTSContext *ts = s->priv_data;
- if (!ts->mpeg2ts_raw) {
- ts->pkt = pkt;
- return handle_packets(ts, 0);
- } else {
- return mpegts_raw_read_packet(s, pkt);
- }
+ ts->pkt = pkt;
+ return handle_packets(ts, 0);
}
static int mpegts_read_close(AVFormatContext *s)
mpegts_get_pcr,
.flags = AVFMT_SHOW_IDS,
};
+
+AVInputFormat mpegtsraw_demuxer = {
+ "mpegtsraw",
+ "MPEG2 raw transport stream format",
+ sizeof(MpegTSContext),
+ mpegts_probe,
+ mpegts_read_header,
+ mpegts_raw_read_packet,
+ mpegts_read_close,
+ read_seek,
+ mpegts_get_pcr,
+ .flags = AVFMT_SHOW_IDS,
+};