diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-12-18 14:50:12 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-18 14:50:12 +0100 |
commit | 99321d1b03b1724011101bf3c1d12beeb406b375 (patch) | |
tree | 469cc329b8b3a5f4714060c7d7d3c320655a6b1b /libavcodec/h264.c | |
parent | 09b4ae8331f8c073792583d1eddf96973f709c89 (diff) | |
download | ffmpeg-99321d1b03b1724011101bf3c1d12beeb406b375.tar.gz |
h264: merge old and new "slice in extradata" checks
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 750229f1c5..c652847600 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -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) { |