summaryrefslogtreecommitdiffstats
path: root/abs/extra-testing/community/mythtv-vdpau/mpegpspatch
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2009-04-10 23:00:34 (GMT)
committerJames Meyer <james.meyer@operamail.com>2009-04-10 23:00:34 (GMT)
commitdf49f7938e10664ead4e809a8c15408c8dea9ac7 (patch)
tree559d922096f8b1ccd8e58d61a694d869c386742f /abs/extra-testing/community/mythtv-vdpau/mpegpspatch
parent34fd09ecfdc4c0b1f2742325646517064920c515 (diff)
downloadlinhes_pkgbuild-df49f7938e10664ead4e809a8c15408c8dea9ac7.zip
linhes_pkgbuild-df49f7938e10664ead4e809a8c15408c8dea9ac7.tar.gz
linhes_pkgbuild-df49f7938e10664ead4e809a8c15408c8dea9ac7.tar.bz2
mythtv: apply patch for lirc delays
http://svn.mythtv.org/trac/ticket/6406 ref FS#318
Diffstat (limited to 'abs/extra-testing/community/mythtv-vdpau/mpegpspatch')
-rw-r--r--abs/extra-testing/community/mythtv-vdpau/mpegpspatch66
1 files changed, 66 insertions, 0 deletions
diff --git a/abs/extra-testing/community/mythtv-vdpau/mpegpspatch b/abs/extra-testing/community/mythtv-vdpau/mpegpspatch
new file mode 100644
index 0000000..eed08eb
--- /dev/null
+++ b/abs/extra-testing/community/mythtv-vdpau/mpegpspatch
@@ -0,0 +1,66 @@
+--- orig_mpeg.c 2009-03-23 11:26:22.000000000 -0700
++++ mpeg.c 2009-03-23 11:28:09.000000000 -0700
+@@ -66,35 +66,40 @@
+
+ static int mpegps_probe(AVProbeData *p)
+ {
++ uint32_t code= -1;
++ int sys=0, pspack=0, priv1=0, vid=0, audio=0, invalid=0;
+ int i;
+- int size= FFMIN(2048, p->buf_size);
+- uint32_t code=0xFF;
++ int score=0;
+
+- /* we search the first start code. If it is a packet start code,
+- then we decide it is mpeg ps. We do not send highest value to
+- give a chance to mpegts */
+- /* NOTE: the search range was restricted to avoid too many false
+- detections */
+-
+- for (i = 0; i < size; i++) {
+- code = (code << 8) | p->buf[i];
++ for(i=0; i<p->buf_size; i++){
++ code = (code<<8) + p->buf[i];
+ if ((code & 0xffffff00) == 0x100) {
+- if (code == PACK_START_CODE ||
+- code == SYSTEM_HEADER_START_CODE ||
+- (code >= 0x1e0 && code <= 0x1ef) ||
+- (code >= 0x1c0 && code <= 0x1df) ||
+- code == PRIVATE_STREAM_2 ||
+- code == PROGRAM_STREAM_MAP ||
+- code == PRIVATE_STREAM_1 ||
+- code == PADDING_STREAM ||
+- code >= 0x100 && code <= 0x1b0)
+- return AVPROBE_SCORE_MAX - 2;
+- else
+- return 0;
++ int pes= check_pes(p->buf+i, p->buf+p->buf_size);
++
++ if(code == SYSTEM_HEADER_START_CODE) sys++;
++ else if(code == PRIVATE_STREAM_1) priv1++;
++ else if(code == PACK_START_CODE) pspack++;
++ else if((code & 0xf0) == VIDEO_ID && pes) vid++;
++ else if((code & 0xe0) == AUDIO_ID && pes) audio++;
++
++ else if((code & 0xf0) == VIDEO_ID && !pes) invalid++;
++ else if((code & 0xe0) == AUDIO_ID && !pes) invalid++;
+ }
+ }
+
+- return 0;
++ if(vid+audio > invalid) /* invalid VDR files nd short PES streams */
++ score= AVPROBE_SCORE_MAX/4;
++
++//av_log(NULL, AV_LOG_ERROR, "%d %d %d %d %d len:%d\n", sys, priv1, pspack,vid, audio, p->buf_size);
++ if(sys>invalid && sys*9 <= pspack*10)
++ return AVPROBE_SCORE_MAX/2+2; // +1 for .mpg
++ if(priv1 + vid + audio > invalid && (priv1+vid+audio)*9 <= pspack*10)
++ return AVPROBE_SCORE_MAX/2+2; // +1 for .mpg
++ if((!!vid ^ !!audio) && (audio > 4 || vid > 1) && !sys && !pspack && p->buf_size>2048) /* PES stream */
++ return AVPROBE_SCORE_MAX/2+2;
++
++ //02-Penguin.flac has sys:0 priv1:0 pspack:0 vid:0 audio:1
++ return score;
+ }
+
+ typedef struct MpegDemuxContext {