Revision a2a98637 libavcodec/truemotion2.c

View differences:

libavcodec/truemotion2.c
757 757
    return keyframe;
758 758
}
759 759

  
760
static const int tm2_stream_order[TM2_NUM_STREAMS] = {
761
    TM2_C_HI, TM2_C_LO, TM2_L_HI, TM2_L_LO, TM2_UPD, TM2_MOT, TM2_TYPE
762
};
763

  
760 764
static int decode_frame(AVCodecContext *avctx,
761 765
                        void *data, int *data_size,
762 766
                        const uint8_t *buf, int buf_size)
763 767
{
764 768
    TM2Context * const l = avctx->priv_data;
765 769
    AVFrame * const p= (AVFrame*)&l->pic;
766
    int skip, t;
770
    int i, skip, t;
767 771

  
768 772
    p->reference = 1;
769 773
    p->buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
......
778 782
    if(skip == -1)
779 783
        return -1;
780 784

  
781
    t = tm2_read_stream(l, buf + skip, TM2_C_HI);
782
    if(t == -1)
783
        return -1;
784
    skip += t;
785
    t = tm2_read_stream(l, buf + skip, TM2_C_LO);
786
    if(t == -1)
787
        return -1;
788
    skip += t;
789
    t = tm2_read_stream(l, buf + skip, TM2_L_HI);
790
    if(t == -1)
791
        return -1;
792
    skip += t;
793
    t = tm2_read_stream(l, buf + skip, TM2_L_LO);
794
    if(t == -1)
795
        return -1;
796
    skip += t;
797
    t = tm2_read_stream(l, buf + skip, TM2_UPD);
798
    if(t == -1)
799
        return -1;
800
    skip += t;
801
    t = tm2_read_stream(l, buf + skip, TM2_MOT);
802
    if(t == -1)
803
        return -1;
804
    skip += t;
805
    t = tm2_read_stream(l, buf + skip, TM2_TYPE);
806
    if(t == -1)
807
        return -1;
785
    for(i = 0; i < TM2_NUM_STREAMS; i++){
786
        t = tm2_read_stream(l, buf + skip, tm2_stream_order[i]);
787
        if(t == -1){
788
            return -1;
789
        }
790
        skip += t;
791
    }
808 792
    p->key_frame = tm2_decode_blocks(l, p);
809 793
    if(p->key_frame)
810 794
        p->pict_type = FF_I_TYPE;

Also available in: Unified diff