# HG changeset patch # User gpoirier # Date 1156852987 0 # Node ID 5abdc17dc283a3837ed897123264d3ceeb536505 # Parent 516cb8ef781a983638a07ffd3af35b421d653e92 add support for information in CDXA format patch by Allan Sandfeld Jensen % kde A carewolf P com % Original thread: Date: Aug 18, 2006 6:33 PM Subject: [Ffmpeg-devel] CDXA in libavformat [patch] diff -r 516cb8ef781a -r 5abdc17dc283 mpeg.c --- a/mpeg.c Tue Aug 29 08:15:38 2006 +0000 +++ b/mpeg.c Tue Aug 29 12:03:07 2006 +0000 @@ -1260,6 +1260,20 @@ #define MAX_SYNC_SIZE 100000 +static int cdxa_probe(AVProbeData *p) +{ + /* check file header */ + if (p->buf_size <= 32) + return 0; + if (p->buf[0] == 'R' && p->buf[1] == 'I' && + p->buf[2] == 'F' && p->buf[3] == 'F' && + p->buf[8] == 'C' && p->buf[9] == 'D' && + p->buf[10] == 'X' && p->buf[11] == 'A') + return AVPROBE_SCORE_MAX; + else + return 0; +} + static int mpegps_probe(AVProbeData *p) { uint32_t code= -1; @@ -1267,6 +1281,10 @@ int i; int score=0; + score = cdxa_probe(p); + if (score > 0) return score; + + /* Search for MPEG stream */ for(i=0; ibuf_size; i++){ code = (code<<8) + p->buf[i]; if ((code & 0xffffff00) == 0x100) {