summaryrefslogtreecommitdiff
path: root/libavcodec/h264_parser.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-02-14 05:20:02 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-02-15 18:29:49 +0100
commitdc971acf4aa31fb5ffb37aad01e6f1fd8e90a0fa (patch)
treea98e51d2e265a12ac142c759c3590f241087273e /libavcodec/h264_parser.c
parentba7dfe5c50b2b618b54ff1e7c3972b07d172f163 (diff)
h264_parser: use enum values in h264_find_frame_end()
Diffstat (limited to 'libavcodec/h264_parser.c')
-rw-r--r--libavcodec/h264_parser.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index b086707dbb..a16229a25e 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -58,13 +58,15 @@ static int h264_find_frame_end(H264Context *h, const uint8_t *buf,
else
state >>= 1; // 2->1, 1->0, 0->0
} else if (state <= 5) {
- int v = buf[i] & 0x1F;
- if (v == 6 || v == 7 || v == 8 || v == 9) {
+ int nalu_type = buf[i] & 0x1F;
+ if (nalu_type == NAL_SEI || nalu_type == NAL_SPS ||
+ nalu_type == NAL_PPS || nalu_type == NAL_AUD) {
if (pc->frame_start_found) {
i++;
goto found;
}
- } else if (v == 1 || v == 2 || v == 5) {
+ } else if (nalu_type == NAL_SLICE || nalu_type == NAL_DPA ||
+ nalu_type == NAL_IDR_SLICE) {
if (pc->frame_start_found) {
state += 8;
continue;