Revision e63a3628 libavformat/thp.c

View differences:

libavformat/thp.c
61 61
    int i;
62 62

  
63 63
    /* Read the file header.  */
64
                           get_be32(pb); /* Skip Magic.  */
65
    thp->version         = get_be32(pb);
64
                           avio_rb32(pb); /* Skip Magic.  */
65
    thp->version         = avio_rb32(pb);
66 66

  
67
                           get_be32(pb); /* Max buf size.  */
68
                           get_be32(pb); /* Max samples.  */
67
                           avio_rb32(pb); /* Max buf size.  */
68
                           avio_rb32(pb); /* Max samples.  */
69 69

  
70
    thp->fps             = av_d2q(av_int2flt(get_be32(pb)), INT_MAX);
71
    thp->framecnt        = get_be32(pb);
72
    thp->first_framesz   = get_be32(pb);
73
                           get_be32(pb); /* Data size.  */
70
    thp->fps             = av_d2q(av_int2flt(avio_rb32(pb)), INT_MAX);
71
    thp->framecnt        = avio_rb32(pb);
72
    thp->first_framesz   = avio_rb32(pb);
73
                           avio_rb32(pb); /* Data size.  */
74 74

  
75
    thp->compoff         = get_be32(pb);
76
                           get_be32(pb); /* offsetDataOffset.  */
77
    thp->first_frame     = get_be32(pb);
78
    thp->last_frame      = get_be32(pb);
75
    thp->compoff         = avio_rb32(pb);
76
                           avio_rb32(pb); /* offsetDataOffset.  */
77
    thp->first_frame     = avio_rb32(pb);
78
    thp->last_frame      = avio_rb32(pb);
79 79

  
80 80
    thp->next_framesz    = thp->first_framesz;
81 81
    thp->next_frame      = thp->first_frame;
82 82

  
83 83
    /* Read the component structure.  */
84 84
    url_fseek (pb, thp->compoff, SEEK_SET);
85
    thp->compcount       = get_be32(pb);
85
    thp->compcount       = avio_rb32(pb);
86 86

  
87 87
    /* Read the list of component types.  */
88
    get_buffer(pb, thp->components, 16);
88
    avio_read(pb, thp->components, 16);
89 89

  
90 90
    for (i = 0; i < thp->compcount; i++) {
91 91
        if (thp->components[i] == 0) {
......
103 103
            st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
104 104
            st->codec->codec_id = CODEC_ID_THP;
105 105
            st->codec->codec_tag = 0;  /* no fourcc */
106
            st->codec->width = get_be32(pb);
107
            st->codec->height = get_be32(pb);
106
            st->codec->width = avio_rb32(pb);
107
            st->codec->height = avio_rb32(pb);
108 108
            st->codec->sample_rate = av_q2d(thp->fps);
109 109
            thp->vst = st;
110 110
            thp->video_stream_index = st->index;
111 111

  
112 112
            if (thp->version == 0x11000)
113
                get_be32(pb); /* Unknown.  */
113
                avio_rb32(pb); /* Unknown.  */
114 114
        } else if (thp->components[i] == 1) {
115 115
            if (thp->has_audio != 0)
116 116
                break;
......
123 123
            st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
124 124
            st->codec->codec_id = CODEC_ID_ADPCM_THP;
125 125
            st->codec->codec_tag = 0;  /* no fourcc */
126
            st->codec->channels    = get_be32(pb); /* numChannels.  */
127
            st->codec->sample_rate = get_be32(pb); /* Frequency.  */
126
            st->codec->channels    = avio_rb32(pb); /* numChannels.  */
127
            st->codec->sample_rate = avio_rb32(pb); /* Frequency.  */
128 128

  
129 129
            av_set_pts_info(st, 64, 1, st->codec->sample_rate);
130 130

  
......
153 153

  
154 154
        /* Locate the next frame and read out its size.  */
155 155
        thp->next_frame += thp->next_framesz;
156
        thp->next_framesz = get_be32(pb);
156
        thp->next_framesz = avio_rb32(pb);
157 157

  
158
                        get_be32(pb); /* Previous total size.  */
159
        size          = get_be32(pb); /* Total size of this frame.  */
158
                        avio_rb32(pb); /* Previous total size.  */
159
        size          = avio_rb32(pb); /* Total size of this frame.  */
160 160

  
161 161
        /* Store the audiosize so the next time this function is called,
162 162
           the audio can be read.  */
163 163
        if (thp->has_audio)
164
            thp->audiosize = get_be32(pb); /* Audio size.  */
164
            thp->audiosize = avio_rb32(pb); /* Audio size.  */
165 165
        else
166 166
            thp->frame++;
167 167

  

Also available in: Unified diff