summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--include/xine/buffer.h3
-rw-r--r--m4/summary.m42
-rw-r--r--src/audio_dec/xine_lpcm_decoder.c47
-rw-r--r--src/combined/ffmpeg/ff_audio_decoder.c43
-rw-r--r--src/combined/ffmpeg/xine_audio.list1
-rw-r--r--src/demuxers/demux_flv.c6
-rw-r--r--src/dxr3/compat.c28
-rw-r--r--src/dxr3/dxr3_decode_spu.c18
-rw-r--r--src/dxr3/dxr3_decode_video.c4
-rw-r--r--src/dxr3/em8300.h120
-rw-r--r--src/dxr3/video_out_dxr3.c12
-rw-r--r--src/dxr3/video_out_dxr3.h6
-rw-r--r--src/libw32dll/w32codec.c6
-rw-r--r--src/xine-engine/audio_out.c7
-rw-r--r--src/xine-engine/buffer_types.c4
-rw-r--r--src/xine-engine/video_out.c5
17 files changed, 243 insertions, 73 deletions
diff --git a/ChangeLog b/ChangeLog
index 15ef8b67c..cefda3f73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -79,7 +79,11 @@ xine-lib (1.1.18) 20??-??-??
Only the Ogg demuxer knows about these at present.
* Added basic support for .qtl (Quicktime media link).
* "Fixed" playback of 24-bit FLAC.
+ * Fixed playback of 24-bit LPCM.
* Work around an ffmpeg bug concerning Sorenson Video 3.
+ * Flash audio bug fixes, mostly concerning AAC.
+ * Fix DXR3 support for newer versions of the em8300 driver.
+ * Added support for WMA Pro.
xine-lib (1.1.17) 2009-12-01
* Add support for Matroska SIMPLEBLOCK.
diff --git a/include/xine/buffer.h b/include/xine/buffer.h
index daf6c5ee9..1a51da6c3 100644
--- a/include/xine/buffer.h
+++ b/include/xine/buffer.h
@@ -238,7 +238,8 @@ extern "C" {
#define BUF_AUDIO_14_4 0x03230000
#define BUF_AUDIO_28_8 0x03240000
#define BUF_AUDIO_SIPRO 0x03250000
-#define BUF_AUDIO_WMAV3 0x03260000
+#define BUF_AUDIO_WMAPRO 0x03260000
+#define BUF_AUDIO_WMAV3 BUF_AUDIO_WMAPRO
#define BUF_AUDIO_INTERPLAY 0x03270000
#define BUF_AUDIO_XA_ADPCM 0x03280000
#define BUF_AUDIO_WESTWOOD 0x03290000
diff --git a/m4/summary.m4 b/m4/summary.m4
index d2ee41fc8..0acfc933a 100644
--- a/m4/summary.m4
+++ b/m4/summary.m4
@@ -145,7 +145,7 @@ AC_DEFUN([XINE_LIB_SUMMARY], [
echo " - ffmpeg (external library)"
else
echo " - ffmpeg (*INTERNAL* library):"
- echo " - Windows Media Audio v1/v2"
+ echo " - Windows Media Audio v1/v2/Pro"
echo " - DV - logarithmic PCM"
echo " - 14k4 - 28k8"
echo " - MS ADPCM - IMA ADPCM"
diff --git a/src/audio_dec/xine_lpcm_decoder.c b/src/audio_dec/xine_lpcm_decoder.c
index ca7802b07..b7e3344fe 100644
--- a/src/audio_dec/xine_lpcm_decoder.c
+++ b/src/audio_dec/xine_lpcm_decoder.c
@@ -273,29 +273,32 @@ static void lpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
uint8_t *d = (uint8_t *)audio_buffer->mem;
int n = buf_size;
- while (n >= 3) {
- if ( stream_be ) {
- if ( stream_be == this->cpu_be ) {
- *d++ = s[0];
- *d++ = s[1];
- } else {
- *d++ = s[1];
- *d++ = s[0];
- }
- } else {
- if ( stream_be == this->cpu_be ) {
- *d++ = s[1];
- *d++ = s[2];
- }
- else
- {
- *d++ = s[2];
- *d++ = s[1];
- }
+ if ( stream_be ) {
+ while (n >= 12) {
+ if ( stream_be == this->cpu_be ) {
+ *d++ = s[0];
+ *d++ = s[1];
+ *d++ = s[2];
+ *d++ = s[3];
+ *d++ = s[4];
+ *d++ = s[5];
+ *d++ = s[6];
+ *d++ = s[7];
+ } else {
+ *d++ = s[1];
+ *d++ = s[0];
+ *d++ = s[3];
+ *d++ = s[2];
+ *d++ = s[5];
+ *d++ = s[4];
+ *d++ = s[7];
+ *d++ = s[6];
+ }
+ s += 12;
+ n -= 12;
}
-
- s += 3;
- n -= 3;
+ } else {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "lpcm_decoder: I don't know what should decode lpcm 24bit little endian byte stream");
}
if ( (d - (uint8_t*)audio_buffer->mem)/2*3 < buf_size )
diff --git a/src/combined/ffmpeg/ff_audio_decoder.c b/src/combined/ffmpeg/ff_audio_decoder.c
index f58fcfb46..b6b5a2075 100644
--- a/src/combined/ffmpeg/ff_audio_decoder.c
+++ b/src/combined/ffmpeg/ff_audio_decoder.c
@@ -93,6 +93,7 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
int out;
audio_buffer_t *audio_buffer;
int bytes_to_send;
+ unsigned int codec_type = buf->type & 0xFFFF0000;
if ( (buf->decoder_flags & BUF_FLAG_HEADER) &&
!(buf->decoder_flags & BUF_FLAG_SPECIAL) ) {
@@ -104,10 +105,8 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
size_t i;
- unsigned int codec_type;
xine_waveformatex *audio_header;
- codec_type = buf->type & 0xFFFF0000;
this->codec = NULL;
for(i = 0; i < sizeof(ff_audio_lookup)/sizeof(ff_codec_t); i++)
@@ -227,7 +226,7 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
}
}
- /* Current ffmpeg audio decoders always use 16 bits/sample
+ /* Current ffmpeg audio decoders usually use 16 bits/sample
* buf->decoder_info[2] can't be used as it doesn't refer to the output
* bits/sample for some codecs (e.g. MS ADPCM) */
this->audio_bits = 16;
@@ -345,14 +344,36 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
return;
}
- if ((decode_buffer_size - out) > audio_buffer->mem_size)
- bytes_to_send = audio_buffer->mem_size;
- else
- bytes_to_send = decode_buffer_size - out;
-
/* fill up this buffer */
- xine_fast_memcpy(audio_buffer->mem, &this->decode_buffer[out],
- bytes_to_send);
+ if (codec_type == BUF_AUDIO_WMAPRO) {
+ /* the above codecs output float samples, not 16-bit integers */
+ int bytes_per_sample = sizeof(float);
+ if (((decode_buffer_size - out) * 2 / bytes_per_sample) > audio_buffer->mem_size)
+ bytes_to_send = audio_buffer->mem_size * bytes_per_sample / 2;
+ else
+ bytes_to_send = decode_buffer_size - out;
+
+ int16_t *int_buffer = calloc(1, bytes_to_send * 2 / bytes_per_sample);
+ int i;
+ for (i = 0; i < (bytes_to_send / bytes_per_sample); i++) {
+ float *float_sample = (float *)&this->decode_buffer[i * bytes_per_sample + out];
+ int_buffer[i] = (int16_t)lrintf(*float_sample * 32768.);
+ }
+
+ out += bytes_to_send;
+ bytes_to_send = bytes_to_send * 2 / bytes_per_sample;
+ xine_fast_memcpy(audio_buffer->mem, int_buffer, bytes_to_send);
+ free(int_buffer);
+ } else {
+ if ((decode_buffer_size - out) > audio_buffer->mem_size)
+ bytes_to_send = audio_buffer->mem_size;
+ else
+ bytes_to_send = decode_buffer_size - out;
+
+ xine_fast_memcpy(audio_buffer->mem, &this->decode_buffer[out], bytes_to_send);
+ out += bytes_to_send;
+ }
+
/* byte count / 2 (bytes / sample) / channels */
audio_buffer->num_frames = bytes_to_send / 2 / this->audio_channels;
@@ -360,8 +381,6 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
buf->pts = 0; /* only first buffer gets the real pts */
this->stream->audio_out->put_buffer (this->stream->audio_out,
audio_buffer, this->stream);
-
- out += bytes_to_send;
}
this->size -= bytes_consumed;
diff --git a/src/combined/ffmpeg/xine_audio.list b/src/combined/ffmpeg/xine_audio.list
index 78d2b62eb..b4a7455ea 100644
--- a/src/combined/ffmpeg/xine_audio.list
+++ b/src/combined/ffmpeg/xine_audio.list
@@ -5,6 +5,7 @@ type=audio
WMAV1 WMAV1 MS Windows Media Audio 1
WMAV2 WMAV2 MS Windows Media Audio 2
+WMAPRO WMAPRO MS Windows Media Audio Professional
14_4 RA_144 Real 14.4
28_8 RA_288 Real 28.8
MPEG MP3 MP3
diff --git a/src/demuxers/demux_flv.c b/src/demuxers/demux_flv.c
index 68670692d..090fe1097 100644
--- a/src/demuxers/demux_flv.c
+++ b/src/demuxers/demux_flv.c
@@ -473,6 +473,12 @@ static int read_flv_packet(demux_flv_t *this, int preview) {
buf->type = buf_type;
fifo->put(fifo, buf);
this->got_audio_header = 1;
+ if (!INPUT_IS_SEEKABLE(this->input)) {
+ /* stop preview processing immediately, this enables libfaad to
+ * initialize even without INPUT_CAP_SEEKABLE of input stream.
+ */
+ preview = 0;
+ }
}
break;
diff --git a/src/dxr3/compat.c b/src/dxr3/compat.c
new file mode 100644
index 000000000..a4722f923
--- /dev/null
+++ b/src/dxr3/compat.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2010 the xine project
+ *
+ * This file is part of xine, a free video player.
+ *
+ * xine is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * xine is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+
+/* For compatibility with em8300 < 0.18.0 */
+int dxr3_compat_ioctl (int fd, int rq, void *arg)
+{
+ int ret = ioctl (fd, rq, arg);
+ if (ret < 0 && errno == EINVAL || errno == ENOTTY)
+ ret = ioctl (fd, rq & 0xFF, arg);
+ return ret;
+}
diff --git a/src/dxr3/dxr3_decode_spu.c b/src/dxr3/dxr3_decode_spu.c
index f4d6f5051..7e7aa1f1a 100644
--- a/src/dxr3/dxr3_decode_spu.c
+++ b/src/dxr3/dxr3_decode_spu.c
@@ -60,6 +60,8 @@
#include "video_out_dxr3.h"
#include "dxr3.h"
+#include "compat.c"
+
#define MAX_SPU_STREAMS 32
@@ -299,7 +301,7 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf)
if (buf->content[0] == 0) /* cheap endianess detection */
dxr3_swab_clut((int *)buf->content);
pthread_mutex_lock(&this->dxr3_vo->spu_device_lock);
- if (ioctl(this->fd_spu, EM8300_IOCTL_SPU_SETPALETTE, buf->content))
+ if (dxr3_spu_setpalette(this->fd_spu, buf->content))
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
"dxr3_decode_spu: failed to set CLUT (%s)\n", strerror(errno));
/* remember clut, when video out places some overlay we may need to restore it */
@@ -368,7 +370,7 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf)
this->menu = 0;
this->button_filter = 1;
pthread_mutex_lock(&this->dxr3_vo->spu_device_lock);
- ioctl(this->fd_spu, EM8300_IOCTL_SPU_BUTTON, NULL);
+ dxr3_spu_button(this->fd_spu, NULL);
write(this->fd_spu, empty_spu, sizeof(empty_spu));
pthread_mutex_unlock(&this->dxr3_vo->spu_device_lock);
}
@@ -486,14 +488,14 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf)
vpts = this->stream->metronom->got_spu_packet(this->stream->metronom, buf->pts);
llprintf(LOG_PTS, "pts = %" PRId64 " vpts = %" PRIu64 "\n", buf->pts, vpts);
vpts32 = vpts;
- if (ioctl(this->fd_spu, EM8300_IOCTL_SPU_SETPTS, &vpts32))
+ if (dxr3_spu_setpts(this->fd_spu, &vpts32))
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
"dxr3_decode_spu: spu setpts failed (%s)\n", strerror(errno));
}
/* has video out tampered with our palette */
if (this->dxr3_vo->clut_cluttered) {
- if (ioctl(this->fd_spu, EM8300_IOCTL_SPU_SETPALETTE, this->clut))
+ if (dxr3_spu_setpalette(this->fd_spu, this->clut))
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
"dxr3_decode_spu: failed to set CLUT (%s)\n", strerror(errno));
this->dxr3_vo->clut_cluttered = 0;
@@ -549,7 +551,7 @@ static void dxr3_spudec_dispose(spu_decoder_t *this_gen)
llprintf(LOG_SPU, "close: SPU_FD = %i\n",this->fd_spu);
pthread_mutex_lock(&this->dxr3_vo->spu_device_lock);
/* clear any remaining spu */
- ioctl(this->fd_spu, EM8300_IOCTL_SPU_BUTTON, NULL);
+ dxr3_spu_button(this->fd_spu, NULL);
write(this->fd_spu, empty_spu, sizeof(empty_spu));
close(this->fd_spu);
this->fd_spu = 0;
@@ -586,7 +588,7 @@ static void dxr3_spudec_set_button(spu_decoder_t *this_gen, int32_t button, int3
if (mode > 0 && !this->button_filter &&
(dxr3_spudec_copy_nav_to_btn(this, mode - 1, &btn ) > 0)) {
pthread_mutex_lock(&this->dxr3_vo->spu_device_lock);
- if (ioctl(this->fd_spu, EM8300_IOCTL_SPU_BUTTON, &btn))
+ if (dxr3_spu_button(this->fd_spu, &btn))
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
"dxr3_decode_spu: failed to set spu button (%s)\n", strerror(errno));
pthread_mutex_unlock(&this->dxr3_vo->spu_device_lock);
@@ -617,7 +619,7 @@ static void dxr3_spudec_process_nav(dxr3_spudec_t *this)
}
if ((dxr3_spudec_copy_nav_to_btn(this, 0, &btn ) > 0)) {
pthread_mutex_lock(&this->dxr3_vo->spu_device_lock);
- if (ioctl(this->fd_spu, EM8300_IOCTL_SPU_BUTTON, &btn))
+ if (dxr3_spu_button(this->fd_spu, &btn))
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
"dxr3_decode_spu: failed to set spu button (%s)\n", strerror(errno));
pthread_mutex_unlock(&this->dxr3_vo->spu_device_lock);
@@ -639,7 +641,7 @@ static void dxr3_spudec_process_nav(dxr3_spudec_t *this)
if ((dxr3_spudec_copy_nav_to_btn(this, 0, &btn ) > 0)) {
pthread_mutex_lock(&this->dxr3_vo->spu_device_lock);
- if (ioctl(this->fd_spu, EM8300_IOCTL_SPU_BUTTON, &btn))
+ if (dxr3_spu_button(this->fd_spu, &btn))
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
"dxr3_decode_spu: failed to set spu button (%s)\n", strerror(errno));
pthread_mutex_unlock(&this->dxr3_vo->spu_device_lock);
diff --git a/src/dxr3/dxr3_decode_video.c b/src/dxr3/dxr3_decode_video.c
index a4e59eb11..252415850 100644
--- a/src/dxr3/dxr3_decode_video.c
+++ b/src/dxr3/dxr3_decode_video.c
@@ -49,6 +49,8 @@
#include "video_out_dxr3.h"
#include "dxr3.h"
+#include "compat.c"
+
/* once activated, we wait for this amount of missing pan&scan info
* before disabling it again */
#define PAN_SCAN_WINDOW_SIZE 50
@@ -554,7 +556,7 @@ static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf)
(this->sync_every_frame || buf->pts)) {
uint32_t vpts32 = vpts;
/* update the dxr3's current pts value */
- if (ioctl(this->fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vpts32))
+ if (dxr3_video_setpts(this->fd_video, &vpts32))
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
"dxr3_decode_video: set video pts failed (%s)\n", strerror(errno));
}
diff --git a/src/dxr3/em8300.h b/src/dxr3/em8300.h
index b862f1d49..f65ceb6f6 100644
--- a/src/dxr3/em8300.h
+++ b/src/dxr3/em8300.h
@@ -1,3 +1,32 @@
+/*
+ * em8300.h
+ *
+ * Copyright (C) 2000 Henrik Johansson <lhj@users.sourceforge.net>
+ * (C) 2000 Ze'ev Maor <zeev@users.sourceforge.net>
+ * (C) 2001 Rick Haines <rick@kuroyi.net>
+ * (C) 2001 Edward Salley <drawdeyellas@hotmail.com>
+ * (C) 2001 Jeremy T. Braun <jtbraun@mmit.edu>
+ * (C) 2001 Ralph Zimmermann <rz@ooe.net>
+ * (C) 2001 Daniel Chassot <Daniel.Chassot@vibro-meter.com>
+ * (C) 2002 Michael Hunold <michael@mihu.de>
+ * (C) 2002-2003 David Holm <mswitch@users.sourceforge.net>
+ * (C) 2003-2008 Nicolas Boullis <nboullis@debian.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
#ifndef LINUX_EM8300_H
#define LINUX_EM8300_H
@@ -85,13 +114,13 @@ typedef struct {
#define EM8300_OVERLAY_SIGNAL_WITH_VGA 2
#define EM8300_OVERLAY_VGA_ONLY 3
-#define EM8300_IOCTL_VIDEO_SETPTS 1
+#define EM8300_IOCTL_VIDEO_SETPTS _IOW('C',1,int)
#define EM8300_IOCTL_VIDEO_GETSCR _IOR('C',2,unsigned)
#define EM8300_IOCTL_VIDEO_SETSCR _IOW('C',2,unsigned)
-#define EM8300_IOCTL_SPU_SETPTS 1
-#define EM8300_IOCTL_SPU_SETPALETTE 2
-#define EM8300_IOCTL_SPU_BUTTON 3
+#define EM8300_IOCTL_SPU_SETPTS _IOW('C',1,int)
+#define EM8300_IOCTL_SPU_SETPALETTE _IOW('C',2,unsigned[16])
+#define EM8300_IOCTL_SPU_BUTTON _IOW('C',3,em8300_button_t)
#define EM8300_ASPECTRATIO_4_3 0
#define EM8300_ASPECTRATIO_16_9 1
@@ -196,6 +225,25 @@ typedef struct {
#define EM8300_MAJOR 121
#define EM8300_LOGNAME "em8300"
+extern int major;
+
+#include <linux/version.h>
+#include <linux/types.h> /* ulong, uint32_t */
+#include <linux/i2c.h> /* struct i2c_adapter */
+#include <linux/i2c-algo-bit.h> /* struct i2c_algo_bit_data */
+#include <linux/time.h> /* struct timeval */
+#include <linux/wait.h> /* wait_queue_head_t */
+#include <linux/list.h> /* struct list_head */
+
+#if defined(CONFIG_SND) || defined(CONFIG_SND_MODULE)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+#define snd_card_t struct snd_card
+#else
+#include <sound/driver.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#endif
+#endif
struct dicom_s {
int luma;
@@ -232,6 +280,31 @@ struct em8300_audio_s {
int enable_bits;
};
+struct em8300_model_config_s {
+ int use_bt865;
+ int dicom_other_pal;
+ int dicom_fix;
+ int dicom_control;
+ int bt865_ucode_timeout;
+ int activate_loopback;
+};
+
+struct adv717x_model_config_s {
+ int pixelport_16bit;
+ int pixelport_other_pal;
+ int pixeldata_adjust_ntsc;
+ int pixeldata_adjust_pal;
+};
+
+struct bt865_model_config_s {
+};
+
+struct em8300_config_s {
+ struct em8300_model_config_s model;
+ struct adv717x_model_config_s adv717x_model;
+ struct bt865_model_config_s bt865_model;
+};
+
struct em8300_s
{
char name[40];
@@ -250,12 +323,8 @@ struct em8300_s
int playmode;
- /* Sysfs */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,46)
- struct class_device classdev;
- struct class_device classdev_mv;
- struct class_device classdev_ma;
- struct class_device classdev_sp;
+#if defined(CONFIG_SND) || defined(CONFIG_SND_MODULE)
+ snd_card_t *alsa_card;
#endif
/* Fifos */
@@ -291,6 +360,7 @@ struct em8300_s
/* I2C clients */
int encoder_type;
struct i2c_client *encoder;
+ struct i2c_client *eeprom;
/* Microcode registers */
unsigned ucode_regs[MAX_UCODE_REGISTER];
@@ -318,14 +388,17 @@ struct em8300_s
int audio_mode;
int pcm_mode;
int dsp_num;
-/* */
- int dword_DB4;
- unsigned char byte_D90[24];
+ /* Channel status for S/PDIF */
+ unsigned int channel_status_pos;
+ unsigned char channel_status[24];
+ enum { NONE, OSS, ALSA } audio_driver_style;
+ struct semaphore audio_driver_style_lock;
/* Video */
int video_mode;
int video_playmode;
int aspect_ratio;
+ int zoom;
uint32_t video_pts;
uint32_t video_lastpts;
int video_ptsvalid,video_offset,video_count;
@@ -375,10 +448,23 @@ struct em8300_s
struct list_head memory;
#endif
+ /* Checksum for the on-board eeprom */
+ u8 *eeprom_checksum;
+
+ int model;
+
+ struct em8300_config_s config;
+
/* To support different options for different cards */
unsigned int card_nr;
};
+#if defined(CONFIG_SND) || defined(CONFIG_SND_MODULE)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+#undef snd_card_t
+#endif
+#endif
+
#define TIMEDIFF(a,b) a.tv_usec - b.tv_usec + \
1000000 * (a.tv_sec - b.tv_sec)
@@ -388,7 +474,8 @@ struct em8300_s
*/
/* em8300_i2c.c */
-int em8300_i2c_init(struct em8300_s *em);
+int em8300_i2c_init1(struct em8300_s *em);
+int em8300_i2c_init2(struct em8300_s *em);
void em8300_i2c_exit(struct em8300_s *em);
void em8300_clockgen_write(struct em8300_s *em, int abyte);
@@ -408,7 +495,8 @@ ssize_t em8300_audio_write(struct em8300_s *em, const char * buf,
int mpegaudio_command(struct em8300_s *em, int cmd);
/* em8300_ucode.c */
-int em8300_ucode_upload(struct em8300_s *em, void *ucode_user, int ucode_size);
+void em8300_ucode_upload(struct em8300_s *em, void *ucode, int ucode_size);
+void em8300_require_ucode(struct em8300_s *em);
/* em8300_misc.c */
int em8300_setregblock(struct em8300_s *em, int offset, int val, int len);
@@ -453,7 +541,7 @@ void em8300_spu_release(struct em8300_s *em);
int em8300_control_ioctl(struct em8300_s *em, int cmd, unsigned long arg);
int em8300_ioctl_setvideomode(struct em8300_s *em, int mode);
int em8300_ioctl_setaspectratio(struct em8300_s *em, int ratio);
-void em8300_ioctl_getstatus(struct em8300_s *em, char *usermsg);
+int em8300_ioctl_getstatus(struct em8300_s *em, char *usermsg);
int em8300_ioctl_init(struct em8300_s *em, em8300_microcode_t *useruc);
void em8300_ioctl_enable_videoout(struct em8300_s *em, int mode);
int em8300_ioctl_setplaymode(struct em8300_s *em, int mode);
diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c
index b6fa0c0ef..233453738 100644
--- a/src/dxr3/video_out_dxr3.c
+++ b/src/dxr3/video_out_dxr3.c
@@ -72,6 +72,8 @@
# include <libavutil/mem.h>
#endif
+#include "compat.c"
+
/* the amount of extra time we give the card for decoding */
#define DECODE_PIPE_PREBUFFER 10000
@@ -847,7 +849,7 @@ static void dxr3_overlay_end(vo_driver_t *this_gen, vo_frame_t *frame_gen)
0x00, 0x01, 0x06, 0x00, 0x04, 0x00, 0x07, 0xFF,
0x00, 0x01, 0x00, 0x20, 0x02, 0xFF };
/* just clear any previous spu */
- ioctl(this->fd_spu, EM8300_IOCTL_SPU_BUTTON, NULL);
+ dxr3_spu_button(this->fd_spu, NULL);
write(this->fd_spu, empty_spu, sizeof(empty_spu));
pthread_mutex_unlock(&this->spu_device_lock);
return;
@@ -859,7 +861,7 @@ static void dxr3_overlay_end(vo_driver_t *this_gen, vo_frame_t *frame_gen)
this->spu_enc->color[6] = this->spu_enc->hili_color[2];
this->spu_enc->color[7] = this->spu_enc->hili_color[3];
/* set palette */
- if (ioctl(this->fd_spu, EM8300_IOCTL_SPU_SETPALETTE, this->spu_enc->color))
+ if (dxr3_spu_setpalette(this->fd_spu, this->spu_enc->color))
xprintf(this->class->xine, XINE_VERBOSITY_DEBUG,
"video_out_dxr3: failed to set CLUT (%s)\n", strerror(errno));
this->clut_cluttered = 1;
@@ -882,7 +884,7 @@ static void dxr3_overlay_end(vo_driver_t *this_gen, vo_frame_t *frame_gen)
btn.right = this->spu_enc->overlay->x + this->spu_enc->overlay->hili_right - 1;
btn.top = this->spu_enc->overlay->y + this->spu_enc->overlay->hili_top;
btn.bottom = this->spu_enc->overlay->y + this->spu_enc->overlay->hili_bottom - 2;
- if (ioctl(this->fd_spu, EM8300_IOCTL_SPU_BUTTON, &btn))
+ if (dxr3_spu_button(this->fd_spu, &btn))
xprintf(this->class->xine, XINE_VERBOSITY_DEBUG,
"dxr3_decode_spu: failed to set spu button (%s)\n", strerror(errno));
@@ -972,7 +974,7 @@ static void dxr3_display_frame(vo_driver_t *this_gen, vo_frame_t *frame_gen)
}
/* inform the card on the timing */
- if (ioctl(this->fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vpts32))
+ if (dxr3_video_setpts(this->fd_video, &vpts32))
xprintf(this->class->xine, XINE_VERBOSITY_DEBUG,
"video_out_dxr3: set video pts failed (%s)\n", strerror(errno));
/* for non-mpeg, the encoder plugin is responsible for calling
@@ -1227,7 +1229,7 @@ static void dxr3_dispose(vo_driver_t *this_gen)
0x00, 0x01, 0x06, 0x00, 0x04, 0x00, 0x07, 0xFF,
0x00, 0x01, 0x00, 0x20, 0x02, 0xFF };
/* clear any remaining spu */
- ioctl(this->fd_spu, EM8300_IOCTL_SPU_BUTTON, NULL);
+ dxr3_spu_button(this->fd_spu, NULL);
write(this->fd_spu, empty_spu, sizeof(empty_spu));
close(this->fd_spu);
}
diff --git a/src/dxr3/video_out_dxr3.h b/src/dxr3/video_out_dxr3.h
index f120c435d..6faabc00f 100644
--- a/src/dxr3/video_out_dxr3.h
+++ b/src/dxr3/video_out_dxr3.h
@@ -174,3 +174,9 @@ int dxr3_lavc_init(dxr3_driver_t *, plugin_node_t *);
/* spu encoder functions */
spu_encoder_t *dxr3_spu_encoder_init(void);
void dxr3_spu_encode(spu_encoder_t *);
+
+#define dxr3_video_setpts(fd,arg) dxr3_compat_ioctl((fd), EM8300_IOCTL_VIDEO_SETPTS, (arg))
+#define dxr3_spu_setpts(fd,arg) dxr3_compat_ioctl((fd), EM8300_IOCTL_SPU_SETPTS, (arg))
+#define dxr3_spu_setpalette(fd,arg) dxr3_compat_ioctl((fd), EM8300_IOCTL_SPU_SETPALETTE, (arg))
+#define dxr3_spu_button(fd,arg) dxr3_compat_ioctl((fd), EM8300_IOCTL_SPU_BUTTON, (arg))
+int dxr3_compat_ioctl (int, int, void *);
diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c
index bfbb590ac..231a0625c 100644
--- a/src/libw32dll/w32codec.c
+++ b/src/libw32dll/w32codec.c
@@ -1086,11 +1086,11 @@ static char* get_auds_codec_name(w32a_decoder_t *this, int buf_type) {
_x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC,
"Windows Media Audio v2 (win32)");
return "divxa32.acm";
- case BUF_AUDIO_WMAV3:
+ case BUF_AUDIO_WMAPRO:
this->driver_type = DRIVER_DMO;
this->guid=&wma3_clsid;
_x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC,
- "Windows Media Audio v3 (win32)");
+ "Windows Media Audio Professional (win32)");
return "wma9dmod.dll";
case BUF_AUDIO_WMALL:
this->driver_type = DRIVER_DMO;
@@ -1668,7 +1668,7 @@ static const decoder_info_t dec_info_video = {
};
static const uint32_t audio_types[] = {
- BUF_AUDIO_WMAV1, BUF_AUDIO_WMAV2, BUF_AUDIO_WMAV3, BUF_AUDIO_MSADPCM,
+ BUF_AUDIO_WMAV1, BUF_AUDIO_WMAV2, BUF_AUDIO_WMAPRO, BUF_AUDIO_MSADPCM,
BUF_AUDIO_MSIMAADPCM, BUF_AUDIO_MSGSM, BUF_AUDIO_IMC, BUF_AUDIO_LH,
BUF_AUDIO_VOXWARE, BUF_AUDIO_ACELPNET, BUF_AUDIO_VIVOG723, BUF_AUDIO_WMAV,
BUF_AUDIO_WMALL,
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index 3a11aa238..6405f6346 100644
--- a/src/xine-engine/audio_out.c
+++ b/src/xine-engine/audio_out.c
@@ -1889,10 +1889,15 @@ static int ao_set_property (xine_audio_port_t *this_gen, int property, int value
case AO_PROP_DISCARD_BUFFERS:
/* recursive discard buffers setting */
+ pthread_mutex_lock(&this->flush_audio_driver_lock);
if(value)
this->discard_buffers++;
- else
+ else if (this->discard_buffers)
this->discard_buffers--;
+ else
+ xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+ "ao_set_property: discard_buffers is already zero\n");
+ pthread_mutex_unlock(&this->flush_audio_driver_lock);
ret = this->discard_buffers;
diff --git a/src/xine-engine/buffer_types.c b/src/xine-engine/buffer_types.c
index 4d4be3a34..413bfb9f0 100644
--- a/src/xine-engine/buffer_types.c
+++ b/src/xine-engine/buffer_types.c
@@ -861,8 +861,8 @@ static const audio_db_t audio_db[] = {
{
0x162, 0
},
- BUF_AUDIO_WMAV3,
- "Windows Media Audio v3"
+ BUF_AUDIO_WMAPRO,
+ "Windows Media Audio Professional"
},
{
{
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index cc21b441d..e4af36e3c 100644
--- a/src/xine-engine/video_out.c
+++ b/src/xine-engine/video_out.c
@@ -1510,8 +1510,11 @@ static int vo_set_property (xine_video_port_t *this_gen, int property, int value
pthread_mutex_lock(&this->display_img_buf_queue->mutex);
if(value)
this->discard_frames++;
- else
+ else if (this->discard_frames)
this->discard_frames--;
+ else
+ xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+ "vo_set_property: discard_frames is already zero\n");
pthread_mutex_unlock(&this->display_img_buf_queue->mutex);
ret = this->discard_frames;