Mercurial > libavformat.hg
changeset 2108:31619b03d1ce libavformat
split mpeg2ts_raw mode into its own demuxer using such a flag is an incredibly dirty hack
author | michael |
---|---|
date | Sat, 02 Jun 2007 20:57:31 +0000 |
parents | d422ebae6dd1 |
children | b5f2710d2dd0 |
files | mpegts.c |
diffstat | 1 files changed, 21 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/mpegts.c Wed May 30 23:42:37 2007 +0000 +++ b/mpegts.c Sat Jun 02 20:57:31 2007 +0000 @@ -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 @@ 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 @@ 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 @@ 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 @@ { 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 @@ 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, +};