summaryrefslogtreecommitdiffstats
path: root/libvo/vo_dxr3.c
diff options
context:
space:
mode:
authormswitch <mswitch@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-03 23:13:56 +0000
committermswitch <mswitch@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-03 23:13:56 +0000
commitf6787a2265915c08bf691784bc85caa5a46c3914 (patch)
tree6937ec2539cbc7afd69f11643906251ab51c2d04 /libvo/vo_dxr3.c
parentaf33819e275f5833d89d756b4181148415c9be02 (diff)
downloadmpv-f6787a2265915c08bf691784bc85caa5a46c3914.tar.bz2
mpv-f6787a2265915c08bf691784bc85caa5a46c3914.tar.xz
Activate QSCALE flag for avcodec
Reset playback speed on exit (we aren't using this feature yet... but will hopefully do soon) Use fsync instead of the mediocre flush ioctl's on seeking/pausing, at least video seems to stay in sync... git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4524 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_dxr3.c')
-rw-r--r--libvo/vo_dxr3.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/libvo/vo_dxr3.c b/libvo/vo_dxr3.c
index 8576375395..3dc56b32ca 100644
--- a/libvo/vo_dxr3.c
+++ b/libvo/vo_dxr3.c
@@ -119,14 +119,14 @@ static uint32_t config(uint32_t scr_width, uint32_t scr_height, uint32_t width,
reg.val = MVCOMMAND_SYNC;
ioctl(fd_control, EM8300_IOCTL_WRITEREG, &reg);
- /* Set the default playback speed to 0x900 */
- ioval = 0x900;
- ioctl(fd_control, EM8300_IOCTL_SCR_SETSPEED, &ioval);
-
/* Flush the buffer and make sure it is clean by syncing it */
ioval = EM8300_SUBDEVICE_VIDEO;
ioctl(fd_control, EM8300_IOCTL_FLUSH, &ioval);
fsync(fd_video);
+ ioval = 0x900;
+ ioctl(fd_control, EM8300_IOCTL_SCR_SETSPEED, &ioval);
+ ioval = 0;
+ ioctl(fd_control, EM8300_IOCTL_SCR_SET, &ioval);
/* We'll be nice and flush the audio buffer as well */
ioval = EM8300_SUBDEVICE_AUDIO;
ioctl(fd_control, EM8300_IOCTL_FLUSH, &ioval);
@@ -172,7 +172,8 @@ static uint32_t config(uint32_t scr_width, uint32_t scr_height, uint32_t width,
avc_context->frame_rate = 30 * FRAME_RATE_BASE;
avc_context->gop_size = 12;
avc_context->bit_rate = 8e6;
- avc_context->flags = CODEC_FLAG_HQ;
+ avc_context->flags = CODEC_FLAG_HQ | CODEC_FLAG_QSCALE;
+ avc_context->quality = 2;
avc_context->pix_fmt = PIX_FMT_YUV420P;
if (avcodec_open(avc_context, avc_codec) < 0) {
printf("VO: [dxr3] Unable to open codec\n");
@@ -239,14 +240,10 @@ static const vo_info_t* get_info(void)
static void draw_alpha(int x0, int y0, int w, int h, unsigned char* src, unsigned char *srca, int srcstride)
{
#ifdef USE_LIBAVCODEC
- /* This function draws the osd and subtitles etc. It will change to use spuenc soon */
- switch (img_format) {
- case IMGFMT_BGR24:
- case IMGFMT_YV12:
- case IMGFMT_YUY2:
+ /* This function draws the osd and subtitles etc. */
+ if (img_format != IMGFMT_MPEGPES) {
vo_draw_alpha_yv12(w, h, src, srca, srcstride,
avc_picture.data[0] + (x0 + d_pos_x) + (y0 + d_pos_y) * avc_picture.linesize[0], avc_picture.linesize[0]);
- break;
}
#endif
}
@@ -264,12 +261,8 @@ static uint32_t draw_frame(uint8_t * src[])
vo_mpegpes_t *p = (vo_mpegpes_t *) src[0];
if (p->id == 0x20) {
- ioval = vo_pts / 2;
- ioctl(fd_spu, EM8300_IOCTL_SPU_SETPTS, &ioval);
write(fd_spu, p->data, p->size);
} else {
- ioval = vo_pts / 2;
- ioctl(fd_video, EM8300_IOCTL_VIDEO_SETPTS, &ioval);
write(fd_video, p->data, p->size);
}
return 0;
@@ -297,8 +290,10 @@ static void flip_page(void)
/* Flush the device if a seek occured */
if (!vo_pts) {
/* Flush video */
- ioval = EM8300_SUBDEVICE_VIDEO;
+ /*ioval = EM8300_SUBDEVICE_VIDEO;
ioctl(fd_control, EM8300_IOCTL_FLUSH, &ioval);
+ */
+ fsync(fd_video);
}
#ifdef USE_LIBAVCODEC
if (img_format == IMGFMT_YV12) {
@@ -390,6 +385,9 @@ static uint32_t query_format(uint32_t format)
static void uninit(void)
{
printf("VO: [dxr3] Uninitializing\n");
+ /* Set the default playback speed to 0x900 */
+ ioval = 0x900;
+ ioctl(fd_control, EM8300_IOCTL_SCR_SETSPEED, &ioval);
#ifdef USE_LIBAVCODEC
if (avc_context) {
avcodec_close(avc_context);