]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/h264_parser.c
configure: Die if gas is unavailable under aarch64 as well as ARM
[ffmpeg] / libavcodec / h264_parser.c
index b086707dbb730cf28764a68941d2ead9c435aa00..8ced0b811d2ea8f370f59949302ae1bff4bfe202 100644 (file)
@@ -30,6 +30,7 @@
 #include "h264data.h"
 #include "golomb.h"
 #include "internal.h"
+#include "mpegutils.h"
 
 #include <assert.h>
 
@@ -47,7 +48,7 @@ static int h264_find_frame_end(H264Context *h, const uint8_t *buf,
 
     for (i = 0; i < buf_size; i++) {
         if (state == 7) {
-            i += h->h264dsp.h264_find_start_code_candidate(buf + i, buf_size - i);
+            i += h->h264dsp.startcode_find_candidate(buf + i, buf_size - i);
             if (i < buf_size)
                 state = 2;
         } else if (state <= 2) {
@@ -58,13 +59,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;