* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+#include "libavutil/crc.h"
#include "avformat.h"
-#include "crc.h"
#include "mpegts.h"
//#define DEBUG_SI
int section_index;
int section_h_size;
uint8_t *section_buf;
- int check_crc:1;
- int end_of_section_reached:1;
+ unsigned int check_crc:1;
+ unsigned int end_of_section_reached:1;
SectionCallback *section_cb;
void *opaque;
} MpegTSSectionFilter;
}
}
- return (!used && discarded);
+ return !used && discarded;
}
/**
pid = filter->pid;
if (filter->type == MPEGTS_SECTION)
av_freep(&filter->u.section_filter.section_buf);
- else if (filter->type == MPEGTS_PES)
- av_freep(&filter->u.pes_filter.opaque);
av_free(filter);
ts->pids[pid] = NULL;
memset(stat, 0, packet_size*sizeof(int));
- for(x=i=0; i<size; i++){
- if(buf[i] == 0x47){
+ for(x=i=0; i<size-3; i++){
+ if(buf[i] == 0x47 && !(buf[i+1] & 0x80) && (buf[i+3] & 0x30)){
stat[x]++;
if(stat[x] > best_score){
best_score= stat[x];
AVInputFormat mpegts_demuxer = {
"mpegts",
- "MPEG2 transport stream format",
+ NULL_IF_CONFIG_SMALL("MPEG-2 transport stream format"),
sizeof(MpegTSContext),
mpegts_probe,
mpegts_read_header,
AVInputFormat mpegtsraw_demuxer = {
"mpegtsraw",
- "MPEG2 raw transport stream format",
+ NULL_IF_CONFIG_SMALL("MPEG-2 raw transport stream format"),
sizeof(MpegTSContext),
NULL,
mpegts_read_header,