From d0fa2231b380995e6daf4bea34cbb80ce9f8200b Mon Sep 17 00:00:00 2001
From: mswitch <mswitch@b3059339-0415-0410-9bf9-f77b7e298cf2>
Date: Sat, 9 Feb 2002 14:44:09 +0000
Subject: [PATCH] Fixed a bug where seeking would lock mplayer

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4610 b3059339-0415-0410-9bf9-f77b7e298cf2
---
 libvo/vo_dxr3.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libvo/vo_dxr3.c b/libvo/vo_dxr3.c
index 9f64e24868..e970e9afaf 100644
--- a/libvo/vo_dxr3.c
+++ b/libvo/vo_dxr3.c
@@ -105,6 +105,7 @@ uint32_t control(uint32_t request, void *data, ...)
 		if (!noprebuf) {
 			close(fd_video);
 			fd_video = open(fdv_name, O_WRONLY);
+			fsync(fd_video);
 		}
 		return VO_TRUE;
 	case VOCTRL_QUERY_FORMAT:
@@ -165,6 +166,10 @@ static uint32_t config(uint32_t scr_width, uint32_t scr_height, uint32_t width,
 	ioctl(fd_control, EM8300_IOCTL_WRITEREG, &reg);
 	
 	/* Clean buffer by syncing it */
+	ioval = EM8300_SUBDEVICE_VIDEO;
+	ioctl(fd_control, EM8300_IOCTL_FLUSH, &ioval);
+	ioval = EM8300_SUBDEVICE_AUDIO;
+	ioctl(fd_control, EM8300_IOCTL_FLUSH, &ioval);
 	fsync(fd_video);
 	ioval = 0x900;
 	ioctl(fd_control, EM8300_IOCTL_SCR_SETSPEED, &ioval);