aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ac3_parser.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2007-09-15 02:41:24 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2007-09-15 02:41:24 +0000
commit3df880934e721d7e37e4feb1d4a3f226cfc1bf2d (patch)
treee73bc62f058a311c71fffecd89a59f323147dc0c /libavcodec/ac3_parser.c
parentd5b7144e1ffa9b1a48832ba5995261873cb211d7 (diff)
downloadffmpeg-3df880934e721d7e37e4feb1d4a3f226cfc1bf2d.tar.gz
better AC3 header error reporting
Originally committed as revision 10496 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ac3_parser.c')
-rw-r--r--libavcodec/ac3_parser.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/ac3_parser.c b/libavcodec/ac3_parser.c
index e8b8b5bee0..d97c86e01b 100644
--- a/libavcodec/ac3_parser.c
+++ b/libavcodec/ac3_parser.c
@@ -44,21 +44,21 @@ int ff_ac3_parse_header(const uint8_t buf[7], AC3HeaderInfo *hdr)
hdr->sync_word = get_bits(&gbc, 16);
if(hdr->sync_word != 0x0B77)
- return -1;
+ return AC3_PARSE_ERROR_SYNC;
/* read ahead to bsid to make sure this is AC-3, not E-AC-3 */
hdr->bsid = show_bits_long(&gbc, 29) & 0x1F;
if(hdr->bsid > 10)
- return -2;
+ return AC3_PARSE_ERROR_BSID;
hdr->crc1 = get_bits(&gbc, 16);
hdr->fscod = get_bits(&gbc, 2);
if(hdr->fscod == 3)
- return -3;
+ return AC3_PARSE_ERROR_SAMPLE_RATE;
hdr->frmsizecod = get_bits(&gbc, 6);
if(hdr->frmsizecod > 37)
- return -4;
+ return AC3_PARSE_ERROR_FRAME_SIZE;
skip_bits(&gbc, 5); // skip bsid, already got it