A packet should contain a full access unit, which for multilayer video should contain all the layers.
Unified · Split
| @@ -262,7 +262,7 @@ static int hevc_find_frame_end(AVCodecParserContext *s, const uint8_t *buf, · 261 unmodified lines | |||
| 262 | int i; | 262 | int i; |
| 263 | 263 | ||
| 264 | for (i = 0; i < buf_size; i++) { | 264 | for (i = 0; i < buf_size; i++) { |
| 265 | int nut; | 265 | int nut, layer_id; |
| 266 | 266 | ||
| 267 | pc->state64 = (pc->state64 << 8) | buf[i]; | 267 | pc->state64 = (pc->state64 << 8) | buf[i]; |
| 268 | 268 | ||
| @@ -270,6 +270,11 @@ static int hevc_find_frame_end(AVCodecParserContext *s, const uint8_t *buf, · 1 unmodified line | |||
| 270 | continue; | 270 | continue; |
| 271 | 271 | ||
| 272 | nut = (pc->state64 >> 2 * 8 + 1) & 0x3F; | 272 | nut = (pc->state64 >> 2 * 8 + 1) & 0x3F; |
| 273 | |||
| 274 | layer_id = (pc->state64 >> 11) & 0x3F; | ||
| 275 | if (layer_id > 0) | ||
| 276 | continue; | ||
| 277 | |||
| 273 | // Beginning of access unit | 278 | // Beginning of access unit |
| 274 | if ((nut >= HEVC_NAL_VPS && nut <= HEVC_NAL_EOB_NUT) || nut == HEVC_NAL_SEI_PREFIX || | 279 | if ((nut >= HEVC_NAL_VPS && nut <= HEVC_NAL_EOB_NUT) || nut == HEVC_NAL_SEI_PREFIX || |
| 275 | (nut >= 41 && nut <= 44) || (nut >= 48 && nut <= 55)) { | 280 | (nut >= 41 && nut <= 44) || (nut >= 48 && nut <= 55)) { |