diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-12-28 12:03:52 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-12-28 12:03:52 +0000 |
commit | a1ec9d78946cd8a26b0ef54b66d773c1328b6efb (patch) | |
tree | 111dff3f659134d77d96e374ac87566d262b07eb /ac3-iec958.c | |
parent | 6fb54e9032b35e409340b3df01c748afb9115a08 (diff) | |
download | mpv-a1ec9d78946cd8a26b0ef54b66d773c1328b6efb.tar.bz2 mpv-a1ec9d78946cd8a26b0ef54b66d773c1328b6efb.tar.xz |
hwac3 fixes by Steven Brookes <stevenjb@mda.co.uk>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3830 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'ac3-iec958.c')
-rw-r--r-- | ac3-iec958.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ac3-iec958.c b/ac3-iec958.c index 3f253a074b..75e98e1ed8 100644 --- a/ac3-iec958.c +++ b/ac3-iec958.c @@ -83,23 +83,23 @@ struct syncframe { } bsi; }; -void ac3_iec958_build_burst(int length, int data_type, int big_endian, unsigned char * data, unsigned char * out) +int ac3_iec958_build_burst(int length, int data_type, int big_endian, unsigned char * data, unsigned char * out) { - const char sync[4] = { 0x72, 0xF8, 0x1F, 0x4E }; + const char sync[6] = { 0x72, 0xF8, 0x1F, 0x4E, 0x00, 0x00 }; - memcpy(out, sync, 4); + memcpy(out, sync, 6); if (length) out[4] = data_type; /* & 0x1F; */ else out[4] = 0; - out[5] = 0x00; - out[6] = (length*8) & 0xFF; - out[7] = ((length*8) >> 8) & 0xFF; + out[6] = (length << 3) & 0xFF; + out[7] = (length >> 5) & 0xFF; if (big_endian) swab(data, out + 8, length); else - memcpy(data, out + 8, length); + memcpy(out + 8, data, length); memset(out + 8 + length, 0, 6144 - 8 - length); + return 6144; } int ac3_iec958_parse_syncinfo(unsigned char *buf, int size, struct hwac3info *ai, int *skipped) |