summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_ts.c
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-08-05 09:01:30 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:15:48 +0200
commit7e57bfd853285f39330d0122e5d8cde3a7cef7fa (patch)
treed8a40c5e289d0d01e571d6d9299a2bde2d67af18 /libmpdemux/demux_ts.c
parent1e403d0593bbe47769d48bf4d60342d4c30c5bce (diff)
downloadmpv-7e57bfd853285f39330d0122e5d8cde3a7cef7fa.tar.bz2
mpv-7e57bfd853285f39330d0122e5d8cde3a7cef7fa.tar.xz
demux: Move mp_a52_framesize from demux_ts.c to parse_es.c
The function is used in the MPEG muxer as well and not specific to MPEG-TS. Jointly developed by Nico Sabbi and myself. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31929 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/demux_ts.c')
-rw-r--r--libmpdemux/demux_ts.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/libmpdemux/demux_ts.c b/libmpdemux/demux_ts.c
index ee52c666ff..2bb5c3c558 100644
--- a/libmpdemux/demux_ts.c
+++ b/libmpdemux/demux_ts.c
@@ -624,47 +624,6 @@ typedef struct {
off_t probe;
} tsdemux_init_t;
-//stripped down version of a52_syncinfo() from liba52
-//copyright belongs to Michel Lespinasse <walken@zoy.org> and Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
-int mp_a52_framesize(uint8_t * buf, int *srate)
-{
- int rate[] = { 32, 40, 48, 56, 64, 80, 96, 112,
- 128, 160, 192, 224, 256, 320, 384, 448,
- 512, 576, 640
- };
- uint8_t halfrate[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3};
- int frmsizecod, bitrate, half;
-
- if((buf[0] != 0x0b) || (buf[1] != 0x77)) /* syncword */
- return 0;
-
- if(buf[5] >= 0x60) /* bsid >= 12 */
- return 0;
-
- half = halfrate[buf[5] >> 3];
-
- frmsizecod = buf[4] & 63;
- if(frmsizecod >= 38)
- return 0;
-
- bitrate = rate[frmsizecod >> 1];
-
- switch(buf[4] & 0xc0)
- {
- case 0: /* 48 KHz */
- *srate = 48000 >> half;
- return 4 * bitrate;
- case 0x40: /* 44.1 KHz */
- *srate = 44100 >> half;
- return 2 * (320 * bitrate / 147 + (frmsizecod & 1));
- case 0x80: /* 32 KHz */
- *srate = 32000 >> half;
- return 6 * bitrate;
- }
-
- return 0;
-}
-
//second stage: returns the count of A52 syncwords found
static int a52_check(char *buf, int len)
{