Mercurial > libavformat.hg
changeset 4365:85ba93088fb5 libavformat
Fix probe & demuxing of Topfield 58XXPVR and 68XXPVR (topfield.rec)
author | michael |
---|---|
date | Tue, 03 Feb 2009 11:01:57 +0000 |
parents | 52e876e7c0cf |
children | 287087dfcc74 |
files | mpegts.c |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/mpegts.c Mon Feb 02 23:43:12 2009 +0000 +++ b/mpegts.c Tue Feb 03 11:01:57 2009 +0000 @@ -1177,14 +1177,15 @@ #if 1 const int size= p->buf_size; int score, fec_score, dvhs_score; + int check_count= size / TS_FEC_PACKET_SIZE; #define CHECK_COUNT 10 - if (size < (TS_FEC_PACKET_SIZE * CHECK_COUNT)) + if (check_count < CHECK_COUNT) return -1; - score = analyze(p->buf, TS_PACKET_SIZE *CHECK_COUNT, TS_PACKET_SIZE, NULL); - dvhs_score = analyze(p->buf, TS_DVHS_PACKET_SIZE *CHECK_COUNT, TS_DVHS_PACKET_SIZE, NULL); - fec_score= analyze(p->buf, TS_FEC_PACKET_SIZE*CHECK_COUNT, TS_FEC_PACKET_SIZE, NULL); + score = analyze(p->buf, TS_PACKET_SIZE *check_count, TS_PACKET_SIZE , NULL)*CHECK_COUNT/check_count; + dvhs_score= analyze(p->buf, TS_DVHS_PACKET_SIZE*check_count, TS_DVHS_PACKET_SIZE, NULL)*CHECK_COUNT/check_count; + fec_score = analyze(p->buf, TS_FEC_PACKET_SIZE *check_count, TS_FEC_PACKET_SIZE , NULL)*CHECK_COUNT/check_count; // av_log(NULL, AV_LOG_DEBUG, "score: %d, dvhs_score: %d, fec_score: %d \n", score, dvhs_score, fec_score); // we need a clear definition for the returned score otherwise things will become messy sooner or later @@ -1235,7 +1236,7 @@ { MpegTSContext *ts = s->priv_data; ByteIOContext *pb = s->pb; - uint8_t buf[1024]; + uint8_t buf[5*1024]; int len; int64_t pos;