diff options
author | phintuka <phintuka> | 2008-07-29 14:01:36 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2008-07-29 14:01:36 +0000 |
commit | d8e45e122e92d3f99d4f75e6041d60046bb649f6 (patch) | |
tree | 708d09c7d085e761474f7833861d98a0bfc70fa3 /tools/pes.c | |
parent | 0d3fd6fb1a6deb58cd7d561658f9f60ba84159bf (diff) | |
download | xineliboutput-d8e45e122e92d3f99d4f75e6041d60046bb649f6.tar.gz xineliboutput-d8e45e122e92d3f99d4f75e6041d60046bb649f6.tar.bz2 |
Added (optimized) macros for NAL testing
Diffstat (limited to 'tools/pes.c')
-rw-r--r-- | tools/pes.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/pes.c b/tools/pes.c index 2b68c55b..5ab9c1ac 100644 --- a/tools/pes.c +++ b/tools/pes.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: pes.c,v 1.4 2008-05-20 11:09:52 phintuka Exp $ + * $Id: pes.c,v 1.5 2008-07-29 14:01:36 phintuka Exp $ * */ @@ -111,7 +111,7 @@ int pes_is_frame_h264(const uint8_t *buf, int len) buf += 9 + buf[8]; - if (!buf[0] && !buf[1] && buf[2] == 0x01 && buf[3] == NAL_AUD) + if (IS_NAL_AUD(buf)) return 1; return 0; } @@ -142,11 +142,9 @@ int pes_get_video_size(const uint8_t *buf, int len, video_size_t *size, int h264 buf += i; len -= i; - if (h264 || (!buf[0] && !buf[1] && buf[2] == 0x01 && buf[3] == NAL_AUD)) + if (h264 || IS_NAL_AUD(buf)) return h264_get_video_size(buf, len, size); - else - return mpeg2_get_video_size(buf, len, size); - return 0; + return mpeg2_get_video_size(buf, len, size); } |