Ticket #5645: 340.patch

File 340.patch, 1.6 KB (added by laga+mythtv@…, 11 years ago)

Import new commits to h264.c

  • libavcodec/h264.c

    commit 97569db10b376f3e267928891dfdba08edf2d8d2
    Author: michael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
    Date:   Tue Sep 2 16:31:18 2008 +0000
    
        Try to support invalid h264 that does not mark IDR with POC=0.
        Fixes issue576.
        
        
        git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15153 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
    
    diff --git a/libavcodec/h264.c b/libavcodec/h264.c
    index 1ea90f1..18b3ea4 100644
    a b static int decode_frame(AVCodecContext *avctx, 
    74887488//FIXME factorize this with the output code below
    74897489        out = h->delayed_pic[0];
    74907490        out_idx = 0;
    7491         for(i=1; h->delayed_pic[i] && h->delayed_pic[i]->poc; i++)
     7491        for(i=1; h->delayed_pic[i] && (h->delayed_pic[i]->poc && !h->delayed_pic[i]->key_frame); i++)
    74927492            if(h->delayed_pic[i]->poc < out->poc){
    74937493                out = h->delayed_pic[i];
    74947494                out_idx = i;
    static int decode_frame(AVCodecContext *avctx, 
    76327632
    76337633            out = h->delayed_pic[0];
    76347634            out_idx = 0;
    7635             for(i=1; h->delayed_pic[i] && h->delayed_pic[i]->poc; i++)
     7635            for(i=1; h->delayed_pic[i] && (h->delayed_pic[i]->poc && !h->delayed_pic[i]->key_frame); i++)
    76367636                if(h->delayed_pic[i]->poc < out->poc){
    76377637                    out = h->delayed_pic[i];
    76387638                    out_idx = i;
    76397639                }
    7640             cross_idr = !h->delayed_pic[0]->poc || !!h->delayed_pic[i];
     7640            cross_idr = !h->delayed_pic[0]->poc || !!h->delayed_pic[i] || h->delayed_pic[0]->key_frame;
    76417641
    76427642            out_of_order = !cross_idr && out->poc < h->outputed_poc;
    76437643