aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2009-01-21 13:27:39 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2009-01-21 13:27:39 +0000
commitd6da3df729b819b08fcb586e77dbb5a02b1f4fde (patch)
treeec5e45a7444b57dd0de6e7f50273e86702b58652
parent8d6fc274faade5d442d19302bf4650ed2099fd73 (diff)
downloadffmpeg-d6da3df729b819b08fcb586e77dbb5a02b1f4fde.tar.gz
yet another attempt on fixing synchronization in VMD
Originally committed as revision 16711 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/sierravmd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c
index 1d21738857..2aeebc4fc8 100644
--- a/libavformat/sierravmd.c
+++ b/libavformat/sierravmd.c
@@ -82,8 +82,7 @@ static int vmd_read_header(AVFormatContext *s,
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 @@ static int vmd_read_header(AVFormatContext *s,
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 @@ static int vmd_read_header(AVFormatContext *s,
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);