summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@users.sourceforge.net>2003-07-11 18:42:40 +0000
committerBastien Nocera <hadess@users.sourceforge.net>2003-07-11 18:42:40 +0000
commit5b1cf1e3cc1ad0b24f3352e4e33e56de74850572 (patch)
tree695f8f38eca5d61f3bd172b62d6501cbeb14aca6
parentcf849000b52d55f01ca4906afde0a85cd45c8bc8 (diff)
downloadxine-lib-5b1cf1e3cc1ad0b24f3352e4e33e56de74850572.tar.gz
xine-lib-5b1cf1e3cc1ad0b24f3352e4e33e56de74850572.tar.bz2
- Fix by Michael Roitzsch to not use callbacks to get the real codecs path (Closes GNOME Bugzilla #116985)
CVS patchset: 5142 CVS date: 2003/07/11 18:42:40
-rw-r--r--src/libreal/audio_decoder.c30
-rw-r--r--src/libreal/xine_decoder.c32
2 files changed, 27 insertions, 35 deletions
diff --git a/src/libreal/audio_decoder.c b/src/libreal/audio_decoder.c
index 250aebeea..0d69d1771 100644
--- a/src/libreal/audio_decoder.c
+++ b/src/libreal/audio_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_decoder.c,v 1.23 2003/04/09 12:29:13 guenter Exp $
+ * $Id: audio_decoder.c,v 1.24 2003/07/11 18:42:40 hadess Exp $
*
* thin layer to use real binary-only codecs in xine
*
@@ -45,8 +45,7 @@
typedef struct {
audio_decoder_class_t decoder_class;
- char *real_codec_path;
-
+ /* empty so far */
} real_class_t;
typedef struct realdec_decoder_s {
@@ -144,9 +143,11 @@ void __builtin_delete (void *foo) {
static int load_syms_linux (realdec_decoder_t *this, char *codec_name) {
+ cfg_entry_t* entry = this->stream->xine->config->lookup_entry(
+ this->stream->xine->config, "codec.real_codecs_path");
char path[1024];
- sprintf (path, "%s/%s", this->cls->real_codec_path, codec_name);
+ sprintf (path, "%s/%s", entry->str_value, codec_name);
#ifdef LOG
printf ("libareal: (audio) opening shared obj '%s'\n", path);
@@ -185,7 +186,7 @@ static int load_syms_linux (realdec_decoder_t *this, char *codec_name) {
char path[1024];
- sprintf(path, "DT_Codecs=%s", this->cls->real_codec_path);
+ sprintf(path, "DT_Codecs=%s", entry->str_value);
if (path[strlen(path)-1]!='/'){
path[strlen(path)+1]=0;
path[strlen(path)]='/';
@@ -697,16 +698,11 @@ void __pure_virtual(void) {
* real audio codec loader
*/
-static void codec_path_cb (void *data, xine_cfg_entry_t *cfg) {
- real_class_t *this = (real_class_t *) data;
-
- this->real_codec_path = cfg->str_value;
-}
-
static void *init_class (xine_t *xine, void *data) {
real_class_t *this;
config_values_t *config = xine->config;
+ char *real_codec_path;
this = (real_class_t *) xine_xmalloc (sizeof (real_class_t));
@@ -715,12 +711,12 @@ static void *init_class (xine_t *xine, void *data) {
this->decoder_class.get_description = get_description;
this->decoder_class.dispose = dispose_class;
- this->real_codec_path = config->register_string (config, "codec.real_codecs_path",
- "unknown",
- _("path to real player codecs, if installed"),
- NULL, 10, codec_path_cb, (void *)this);
+ real_codec_path = config->register_string (config, "codec.real_codecs_path",
+ "unknown",
+ _("path to real player codecs, if installed"),
+ NULL, 10, NULL, NULL);
- if (!strcmp (this->real_codec_path, "unknown")) {
+ if (!strcmp (real_codec_path, "unknown")) {
struct stat s;
@@ -747,7 +743,7 @@ static void *init_class (xine_t *xine, void *data) {
}
#ifdef LOG
- printf ("libareal: real codec path : %s\n", this->real_codec_path);
+ printf ("libareal: real codec path : %s\n", real_codec_path);
#endif
return this;
diff --git a/src/libreal/xine_decoder.c b/src/libreal/xine_decoder.c
index eb981ba74..287fb0083 100644
--- a/src/libreal/xine_decoder.c
+++ b/src/libreal/xine_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_decoder.c,v 1.40 2003/07/09 22:09:10 jstembridge Exp $
+ * $Id: xine_decoder.c,v 1.41 2003/07/11 18:42:40 hadess Exp $
*
* thin layer to use real binary-only codecs in xine
*
@@ -46,8 +46,7 @@
typedef struct {
video_decoder_class_t decoder_class;
- char *real_codec_path;
-
+ /* empty so far */
} real_class_t;
#define BUF_SIZE 65536
@@ -70,7 +69,7 @@ typedef struct realdec_decoder_s {
void *context;
- int width, height;
+ uint32_t width, height;
uint8_t *chunk_buffer;
int chunk_buffer_size;
@@ -148,9 +147,11 @@ static void hexdump (char *buf, int length) {
static int load_syms_linux (realdec_decoder_t *this, char *codec_name) {
+ cfg_entry_t* entry = this->stream->xine->config->lookup_entry(
+ this->stream->xine->config, "codec.real_codecs_path");
char path[1024];
- sprintf (path, "%s/%s", this->cls->real_codec_path, codec_name);
+ sprintf (path, "%s/%s", entry->str_value, codec_name);
#ifdef LOG
printf ("libreal: opening shared obj '%s'\n", path);
@@ -258,7 +259,6 @@ static int init_codec (realdec_decoder_t *this, buf_element_t *buf) {
if ((init_data.format>=0x20200002) && (buf->type != BUF_VIDEO_RV40)) {
unsigned long cmsg24[8];
unsigned long cmsg_data[9];
- int result;
cmsg24[0]=this->width;
cmsg24[1]=this->height;
@@ -296,7 +296,7 @@ static int init_codec (realdec_decoder_t *this, buf_element_t *buf) {
}
static void realdec_copy_frame (realdec_decoder_t *this, uint8_t *base[3], int pitches[3]) {
- int i, j;
+ uint_fast32_t i, j;
uint8_t *src, *dst;
src = this->frame_buffer;
@@ -607,16 +607,12 @@ void __pure_virtual(void) {
/* exit(1); */
}
-static void codec_path_cb (void *data, xine_cfg_entry_t *cfg) {
- real_class_t *this = (real_class_t *) data;
-
- this->real_codec_path = cfg->str_value;
-}
static void *init_class (xine_t *xine, void *data) {
real_class_t *this;
config_values_t *config = xine->config;
+ char *real_codec_path;
this = (real_class_t *) xine_xmalloc (sizeof (real_class_t));
@@ -625,12 +621,12 @@ static void *init_class (xine_t *xine, void *data) {
this->decoder_class.get_description = get_description;
this->decoder_class.dispose = dispose_class;
- this->real_codec_path = config->register_string (config, "codec.real_codecs_path",
- "unknown",
- _("path to real player codecs, if installed"),
- NULL, 10, codec_path_cb, (void *)this);
+ real_codec_path = config->register_string (config, "codec.real_codecs_path",
+ "unknown",
+ _("path to real player codecs, if installed"),
+ NULL, 10, NULL, NULL);
- if (!strcmp (this->real_codec_path, "unknown")) {
+ if (!strcmp (real_codec_path, "unknown")) {
struct stat s;
@@ -657,7 +653,7 @@ static void *init_class (xine_t *xine, void *data) {
}
#ifdef LOG
- printf ("libareal: real codec path : %s\n", this->real_codec_path);
+ printf ("libareal: real codec path : %s\n", real_codec_path);
#endif
return this;