Revision d6da3df7 libavformat/sierravmd.c

View differences:

libavformat/sierravmd.c
82 82
    int64_t current_offset;
83 83
    int i, j;
84 84
    unsigned int total_frames;
85
    int64_t pts_inc = 1;
86
    int64_t current_video_pts = 0, current_audio_pts = 0;
85
    int64_t current_audio_pts = 0;
87 86
    unsigned char chunk[BYTES_PER_FRAME_RECORD];
88 87
    int num, den;
89 88
    int sound_buffers;
......
144 143
        av_reduce(&den, &num, den, num, (1UL<<31)-1);
145 144
        av_set_pts_info(vst, 33, num, den);
146 145
        av_set_pts_info(st, 33, num, den);
147
        pts_inc = num;
148 146
    }
149 147

  
150 148
    toc_offset = AV_RL32(&vmd->vmd_header[812]);
......
199 197
                memcpy(vmd->frame_table[total_frames].frame_record, chunk, BYTES_PER_FRAME_RECORD);
200 198
                vmd->frame_table[total_frames].pts = current_audio_pts;
201 199
                total_frames++;
202
                current_audio_pts += pts_inc;
200
                if(!current_audio_pts)
201
                    current_audio_pts += sound_buffers;
202
                else
203
                    current_audio_pts++;
203 204
                break;
204 205
            case 2: /* Video Chunk */
205 206
                vmd->frame_table[total_frames].frame_offset = current_offset;
206 207
                vmd->frame_table[total_frames].stream_index = vmd->video_stream_index;
207 208
                vmd->frame_table[total_frames].frame_size = size;
208 209
                memcpy(vmd->frame_table[total_frames].frame_record, chunk, BYTES_PER_FRAME_RECORD);
209
                vmd->frame_table[total_frames].pts = current_video_pts;
210
                vmd->frame_table[total_frames].pts = i;
210 211
                total_frames++;
211 212
                break;
212 213
            }
213 214
            current_offset += size;
214 215
        }
215
        current_video_pts += pts_inc;
216 216
    }
217 217

  
218 218
    av_free(raw_frame_table);

Also available in: Unified diff