h264: merge old and new "slice in extradata" checks

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-12-18 14:50:12 +01:00
parent 09b4ae8331
commit 99321d1b03
1 changed files with 6 additions and 14 deletions

View File

@ -3924,20 +3924,10 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
continue;
again:
/* Ignore every NAL unit type except PPS and SPS during extradata
/* Ignore per frame NAL unit type during extradata
* parsing. Decoding slices is not possible in codec init
* with frame-mt */
if (parse_extradata && HAVE_THREADS &&
(s->avctx->active_thread_type & FF_THREAD_FRAME) &&
(hx->nal_unit_type != NAL_PPS &&
hx->nal_unit_type != NAL_SPS)) {
av_log(avctx, AV_LOG_INFO, "Ignoring NAL unit %d during "
"extradata parsing\n", hx->nal_unit_type);
hx->nal_unit_type = NAL_FF_IGNORE;
}
err = 0;
if (h->decoding_extradata) {
if (parse_extradata) {
switch (hx->nal_unit_type) {
case NAL_IDR_SLICE:
case NAL_SLICE:
@ -3945,11 +3935,13 @@ again:
case NAL_DPB:
case NAL_DPC:
case NAL_AUXILIARY_SLICE:
av_log(h->s.avctx, AV_LOG_WARNING, "Ignoring NAL %d in global header\n", hx->nal_unit_type);
hx->nal_unit_type = NAL_FILLER_DATA;
av_log(h->s.avctx, AV_LOG_WARNING, "Ignoring NAL %d in global header/extradata\n", hx->nal_unit_type);
hx->nal_unit_type = NAL_FF_IGNORE;
}
}
err = 0;
switch (hx->nal_unit_type) {
case NAL_IDR_SLICE:
if (first_slice != NAL_IDR_SLICE) {