From 52665ca17499adab805a5c0d5bae8a35ed7ccd52 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Thu, 15 May 2003 17:46:22 +0000 Subject: current ivtv api doesn't support changing setting on the fly CVS patchset: 4854 CVS date: 2003/05/15 17:46:22 --- src/input/input_pvr.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/input/input_pvr.c b/src/input/input_pvr.c index ef3a7f69d..2f94ebe4e 100644 --- a/src/input/input_pvr.c +++ b/src/input/input_pvr.c @@ -38,7 +38,7 @@ * usage: * xine pvr:/\!\! * - * $Id: input_pvr.c,v 1.23 2003/05/15 16:41:57 miguelfreitas Exp $ + * $Id: input_pvr.c,v 1.24 2003/05/15 17:46:22 miguelfreitas Exp $ */ /************************************************************************** @@ -1128,11 +1128,21 @@ static void pvr_event_handler (pvr_input_plugin_t *this) { struct ivtv_ioctl_codec codec; pthread_mutex_lock(&this->dev_lock); + + /* how lame. we must close and reopen to change bitrate. */ + close(this->dev_fd); + this->dev_fd = open (PVR_DEVICE, O_RDWR); + if (this->dev_fd == -1) { + printf("input_pvr: error opening device %s\n", PVR_DEVICE ); + return; + } + if (ioctl(this->dev_fd, IVTV_IOC_G_CODEC, &codec) < 0) { printf("input_pvr: IVTV_IOC_G_CODEC failed, maybe API changed?\n"); } else { codec.bitrate = mpeg_data->bitrate_mean; codec.bitrate_peak = mpeg_data->bitrate_peak; + codec.stream_type = IVTV_STREAM_DVD; if (ioctl(this->dev_fd, IVTV_IOC_S_CODEC, &codec) < 0) { printf("input_pvr: IVTV_IOC_S_CODEC failed, maybe API changed?\n"); -- cgit v1.2.3