Mercurial > libavformat.hg
changeset 4268:85608ac6c804 libavformat
yet another attempt on fixing synchronization in VMD
author | kostya |
---|---|
date | Wed, 21 Jan 2009 13:27:39 +0000 |
parents | ce5b09a7f263 |
children | bbb6561a3974 |
files | sierravmd.c |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/sierravmd.c Wed Jan 21 13:26:01 2009 +0000 +++ b/sierravmd.c Wed Jan 21 13:27:39 2009 +0000 @@ -82,8 +82,7 @@ int64_t current_offset; int i, j; unsigned int total_frames; - int64_t pts_inc = 1; - int64_t current_video_pts = 0, current_audio_pts = 0; + int64_t current_audio_pts = 0; unsigned char chunk[BYTES_PER_FRAME_RECORD]; int num, den; int sound_buffers; @@ -144,7 +143,6 @@ av_reduce(&den, &num, den, num, (1UL<<31)-1); av_set_pts_info(vst, 33, num, den); av_set_pts_info(st, 33, num, den); - pts_inc = num; } toc_offset = AV_RL32(&vmd->vmd_header[812]); @@ -199,20 +197,22 @@ memcpy(vmd->frame_table[total_frames].frame_record, chunk, BYTES_PER_FRAME_RECORD); vmd->frame_table[total_frames].pts = current_audio_pts; total_frames++; - current_audio_pts += pts_inc; + if(!current_audio_pts) + current_audio_pts += sound_buffers; + else + current_audio_pts++; break; case 2: /* Video Chunk */ vmd->frame_table[total_frames].frame_offset = current_offset; vmd->frame_table[total_frames].stream_index = vmd->video_stream_index; vmd->frame_table[total_frames].frame_size = size; memcpy(vmd->frame_table[total_frames].frame_record, chunk, BYTES_PER_FRAME_RECORD); - vmd->frame_table[total_frames].pts = current_video_pts; + vmd->frame_table[total_frames].pts = i; total_frames++; break; } current_offset += size; } - current_video_pts += pts_inc; } av_free(raw_frame_table);