Ticket #7522: mythtv_ffmpeg_r20504.diff

File mythtv_ffmpeg_r20504.diff, 2.1 KB (added by tralph11@…, 3 years ago)

official solution from FFmpeg r20504 by michael

  • libs/libavcodec/h264.c

     
    77917791    if(!(s->flags2 & CODEC_FLAG2_CHUNKS) || (s->mb_y >= s->mb_height && s->mb_height)){ 
    77927792        Picture *out = s->current_picture_ptr; 
    77937793        Picture *cur = s->current_picture_ptr; 
    7794         int i, pics, cross_idr, out_of_order, out_idx; 
     7794        int i, pics, out_of_order, out_idx; 
    77957795 
    77967796        field_end(h); 
    77977797 
     
    78957895                    out = h->delayed_pic[i]; 
    78967896                    out_idx = i; 
    78977897                } 
    7898             cross_idr = !!h->delayed_pic[i] || h->delayed_pic[0]->key_frame || h->delayed_pic[0]->mmco_reset; 
     7898            if(s->avctx->has_b_frames == 0 && (h->delayed_pic[0]->key_frame || h->delayed_pic[0]->mmco_reset)) 
     7899                h->outputed_poc= INT_MIN; 
     7900            out_of_order = out->poc < h->outputed_poc; 
    78997901 
    7900             out_of_order = !cross_idr && out->poc < h->outputed_poc; 
    7901  
    79027902            if(h->sps.bitstream_restriction_flag && s->avctx->has_b_frames >= h->sps.num_reorder_frames) 
    79037903                { } 
    79047904            else if((out_of_order && pics-1 == s->avctx->has_b_frames && s->avctx->has_b_frames < MAX_DELAYED_PIC_COUNT) 
    79057905               || (s->low_delay && 
    7906                 ((!cross_idr && out->poc > h->outputed_poc + 2) 
     7906                ((h->outputed_poc != INT_MIN && out->poc > h->outputed_poc + 2) 
    79077907                 || cur->pict_type == FF_B_TYPE))) 
    79087908            { 
    79097909                s->low_delay = 0; 
     
    79187918            if(!out_of_order && pics > s->avctx->has_b_frames){ 
    79197919                *data_size = sizeof(AVFrame); 
    79207920 
    7921                 h->outputed_poc = out->poc; 
     7921                if(out_idx==0 && h->delayed_pic[0] && (h->delayed_pic[0]->key_frame || h->delayed_pic[0]->mmco_reset)) { 
     7922                    h->outputed_poc = INT_MIN; 
     7923                } else 
     7924                    h->outputed_poc = out->poc; 
    79227925                *pict= *(AVFrame*)out; 
    79237926            }else{ 
    79247927                av_log(avctx, AV_LOG_DEBUG, "no picture\n");