Revision ae447836

View differences:

libavformat/utils.c
2019 2019
    return enc->codec_id != CODEC_ID_NONE && val != 0;
2020 2020
}
2021 2021

  
2022
static int has_decode_delay_been_guessed(AVStream *st)
2023
{
2024
    return st->codec->codec_id != CODEC_ID_H264 ||
2025
        st->codec_info_nb_frames >= 4 + st->codec->has_b_frames;
2026
}
2027

  
2022 2028
static int try_decode_frame(AVStream *st, AVPacket *avpkt)
2023 2029
{
2024 2030
    int16_t *samples;
......
2035 2041
            return ret;
2036 2042
    }
2037 2043

  
2038
    if(!has_codec_parameters(st->codec)){
2044
    if(!has_codec_parameters(st->codec) || !has_decode_delay_been_guessed(st)){
2039 2045
        switch(st->codec->codec_type) {
2040 2046
        case AVMEDIA_TYPE_VIDEO:
2041 2047
            avcodec_get_frame_defaults(&picture);
......
2317 2323
           decompress the frame. We try to avoid that in most cases as
2318 2324
           it takes longer and uses more memory. For MPEG-4, we need to
2319 2325
           decompress for QuickTime. */
2320
        if (!has_codec_parameters(st->codec))
2326
        if (!has_codec_parameters(st->codec) || !has_decode_delay_been_guessed(st))
2321 2327
            try_decode_frame(st, pkt);
2322 2328

  
2323 2329
        count++;

Also available in: Unified diff