mirror of https://git.ffmpeg.org/ffmpeg.git
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
This commit is contained in:
parent
69ddbd1dad
commit
38c48be213
|
@ -21,6 +21,7 @@
|
||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
#include "crc.h"
|
#include "crc.h"
|
||||||
#include "mpegts.h"
|
#include "mpegts.h"
|
||||||
|
#include "allformats.h"
|
||||||
|
|
||||||
//#define DEBUG_SI
|
//#define DEBUG_SI
|
||||||
//#define DEBUG_SEEK
|
//#define DEBUG_SEEK
|
||||||
|
@ -89,8 +90,6 @@ struct MpegTSContext {
|
||||||
int auto_guess;
|
int auto_guess;
|
||||||
int set_service_ret;
|
int set_service_ret;
|
||||||
|
|
||||||
/** force raw MPEG2 transport stream output, if possible */
|
|
||||||
int mpeg2ts_raw;
|
|
||||||
/** compute exact PCR for each transport stream packet */
|
/** compute exact PCR for each transport stream packet */
|
||||||
int mpeg2ts_compute_pcr;
|
int mpeg2ts_compute_pcr;
|
||||||
|
|
||||||
|
@ -1204,8 +1203,11 @@ static int mpegts_read_header(AVFormatContext *s,
|
||||||
MpegTSService *service;
|
MpegTSService *service;
|
||||||
|
|
||||||
if (ap) {
|
if (ap) {
|
||||||
ts->mpeg2ts_raw = ap->mpeg2ts_raw;
|
|
||||||
ts->mpeg2ts_compute_pcr = ap->mpeg2ts_compute_pcr;
|
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 */
|
/* read the first 1024 bytes to get packet size */
|
||||||
|
@ -1220,7 +1222,7 @@ static int mpegts_read_header(AVFormatContext *s,
|
||||||
ts->auto_guess = 0;
|
ts->auto_guess = 0;
|
||||||
|
|
||||||
goto_auto_guess:
|
goto_auto_guess:
|
||||||
if (!ts->mpeg2ts_raw) {
|
if (s->iformat == &mpegts_demuxer) {
|
||||||
/* normal demux */
|
/* normal demux */
|
||||||
|
|
||||||
if (!ts->auto_guess) {
|
if (!ts->auto_guess) {
|
||||||
|
@ -1396,12 +1398,8 @@ static int mpegts_read_packet(AVFormatContext *s,
|
||||||
{
|
{
|
||||||
MpegTSContext *ts = s->priv_data;
|
MpegTSContext *ts = s->priv_data;
|
||||||
|
|
||||||
if (!ts->mpeg2ts_raw) {
|
ts->pkt = pkt;
|
||||||
ts->pkt = pkt;
|
return handle_packets(ts, 0);
|
||||||
return handle_packets(ts, 0);
|
|
||||||
} else {
|
|
||||||
return mpegts_raw_read_packet(s, pkt);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mpegts_read_close(AVFormatContext *s)
|
static int mpegts_read_close(AVFormatContext *s)
|
||||||
|
@ -1550,3 +1548,16 @@ AVInputFormat mpegts_demuxer = {
|
||||||
mpegts_get_pcr,
|
mpegts_get_pcr,
|
||||||
.flags = AVFMT_SHOW_IDS,
|
.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,
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue