summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-01-24 15:16:39 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-01-24 15:16:39 +0000
commit71dcc053fe61841201abe1034a86eae863197c48 (patch)
tree295ae2ca646e5bfa6b4f42edc68e15645b6eb214 /libmpcodecs
parent213092c8dcfc925d8d54cf320b60cf298a870696 (diff)
downloadmpv-71dcc053fe61841201abe1034a86eae863197c48.tar.bz2
mpv-71dcc053fe61841201abe1034a86eae863197c48.tar.xz
Move the resync-related code into more consistent places instead of having it
scattered all over the place with half of it forgotten in some places. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30420 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/dec_audio.c2
-rw-r--r--libmpcodecs/dec_video.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/libmpcodecs/dec_audio.c b/libmpcodecs/dec_audio.c
index d73b381906..26681737e3 100644
--- a/libmpcodecs/dec_audio.c
+++ b/libmpcodecs/dec_audio.c
@@ -455,6 +455,8 @@ int decode_audio(sh_audio_t *sh_audio, int minlen)
void resync_audio_stream(sh_audio_t *sh_audio)
{
+ sh_audio->a_buffer_len = 0;
+ sh_audio->a_out_buffer_len = 0;
sh_audio->a_in_buffer_len = 0; // clear audio input buffer
if (!sh_audio->initialized)
return;
diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c
index 6d9eb97074..6cc2ddd55e 100644
--- a/libmpcodecs/dec_video.c
+++ b/libmpcodecs/dec_video.c
@@ -133,6 +133,10 @@ int set_rectangle(sh_video_t *sh_video,int param,int value)
void resync_video_stream(sh_video_t *sh_video)
{
+ sh_video->timer = 0;
+ sh_video->next_frame_time = 0;
+ sh_video->num_buffered_pts = 0;
+ sh_video->last_pts = MP_NOPTS_VALUE;
if(mpvdec) mpvdec->control(sh_video, VDCTRL_RESYNC_STREAM, NULL);
}