Revision 716ba2d0 libavformat/sierravmd.c

View differences:

libavformat/sierravmd.c
193 193
            case 1: /* Audio Chunk */
194 194
                if (!st) break;
195 195
                /* first audio chunk contains several audio buffers */
196
                if(current_audio_pts){
197 196
                    vmd->frame_table[total_frames].frame_offset = current_offset;
198 197
                    vmd->frame_table[total_frames].stream_index = vmd->audio_stream_index;
199 198
                    vmd->frame_table[total_frames].frame_size = size;
......
201 200
                    vmd->frame_table[total_frames].pts = current_audio_pts;
202 201
                    total_frames++;
203 202
                    current_audio_pts += pts_inc;
204
                }else{
205
                    uint32_t flags;
206
                    int k;
207
                    int noff;
208
                    int64_t pos;
209

  
210
                    pos = url_ftell(pb);
211
                    url_fseek(pb, current_offset, SEEK_SET);
212
                    flags = get_le32(pb);
213
                    noff = 4;
214
                    url_fseek(pb, pos, SEEK_SET);
215
                    av_log(s, AV_LOG_DEBUG, "Sound mapping = %08X (%i bufs)\n", flags, sound_buffers);
216
                    for(k = 0; k < sound_buffers - 1; k++){
217
                        if(flags & 1) { /* silent block */
218
                            vmd->frame_table[total_frames].frame_size = 0;
219
                        }else{
220
                            vmd->frame_table[total_frames].frame_size = st->codec->block_align + (st->codec->block_align & 1);
221
                        }
222
                        noff += vmd->frame_table[total_frames].frame_size;
223
                        vmd->frame_table[total_frames].frame_offset = current_offset + noff;
224
                        vmd->frame_table[total_frames].stream_index = vmd->audio_stream_index;
225
                        memcpy(vmd->frame_table[total_frames].frame_record, chunk, BYTES_PER_FRAME_RECORD);
226
                        vmd->frame_table[total_frames].pts = current_audio_pts;
227
                        total_frames++;
228
                        current_audio_pts += pts_inc;
229
                        flags >>= 1;
230
                    }
231
                }
232 203
                break;
233 204
            case 2: /* Video Chunk */
234 205
                vmd->frame_table[total_frames].frame_offset = current_offset;

Also available in: Unified diff