Commit 38c48be2 authored by Michael Niedermayer's avatar Michael Niedermayer

split mpeg2ts_raw mode into its own demuxer using such a flag is an incredibly dirty hack

Originally committed as revision 9173 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 69ddbd1d
......@@ -21,6 +21,7 @@
#include "avformat.h"
#include "crc.h"
#include "mpegts.h"
#include "allformats.h"
//#define DEBUG_SI
//#define DEBUG_SEEK
......@@ -89,8 +90,6 @@ struct MpegTSContext {
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;
......@@ -1204,8 +1203,11 @@ static int mpegts_read_header(AVFormatContext *s,
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 */
......@@ -1220,7 +1222,7 @@ static int mpegts_read_header(AVFormatContext *s,
ts->auto_guess = 0;
goto_auto_guess:
if (!ts->mpeg2ts_raw) {
if (s->iformat == &mpegts_demuxer) {
/* normal demux */
if (!ts->auto_guess) {
......@@ -1396,12 +1398,8 @@ static int mpegts_read_packet(AVFormatContext *s,
{
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)
......@@ -1550,3 +1548,16 @@ AVInputFormat mpegts_demuxer = {
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,
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment