mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-30 11:08:34 +00:00
gst/real/gstrealaudiodec.c: Use the proper context variable when setting the password !
Original commit message from CVS: * gst/real/gstrealaudiodec.c: (gst_real_audio_dec_setcaps): Use the proper context variable when setting the password ! LOG => WARNING for errors. Give proper path when opening the codec (needs a '/' at the end).
This commit is contained in:
parent
58791b4e6f
commit
1b0a8436b4
2 changed files with 20 additions and 10 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2007-07-26 Edward Hervey <bilboed@bilboed.com>
|
||||||
|
|
||||||
|
* gst/real/gstrealaudiodec.c: (gst_real_audio_dec_setcaps):
|
||||||
|
Use the proper context variable when setting the password !
|
||||||
|
LOG => WARNING for errors.
|
||||||
|
Give proper path when opening the codec (needs a '/' at the end).
|
||||||
|
|
||||||
2007-07-25 Tim-Philipp Müller <tim at centricular dot net>
|
2007-07-25 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* gst/real/Makefile.am:
|
* gst/real/Makefile.am:
|
||||||
|
|
|
@ -195,7 +195,7 @@ gst_real_audio_dec_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
gchar *path, *names;
|
gchar *path, *names;
|
||||||
gchar **split_names, **split_path;
|
gchar **split_names, **split_path;
|
||||||
gint version, flavor, channels, rate, leaf_size, packet_size, width, height;
|
gint version, flavor, channels, rate, leaf_size, packet_size, width, height;
|
||||||
guint16 res;
|
guint16 res = 0;
|
||||||
RAInit data;
|
RAInit data;
|
||||||
gboolean bres;
|
gboolean bres;
|
||||||
const GValue *v;
|
const GValue *v;
|
||||||
|
@ -205,6 +205,7 @@ gst_real_audio_dec_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
gpointer context = NULL;
|
gpointer context = NULL;
|
||||||
RealFunctions funcs = { NULL, };
|
RealFunctions funcs = { NULL, };
|
||||||
int i, j;
|
int i, j;
|
||||||
|
gchar *tmppath = NULL;
|
||||||
|
|
||||||
if (!strcmp (name, "audio/x-sipro"))
|
if (!strcmp (name, "audio/x-sipro"))
|
||||||
version = GST_REAL_AUDIO_DEC_VERSION_SIPR;
|
version = GST_REAL_AUDIO_DEC_VERSION_SIPR;
|
||||||
|
@ -293,13 +294,15 @@ codec_search_done:
|
||||||
if (funcs.SetDLLAccessPath)
|
if (funcs.SetDLLAccessPath)
|
||||||
funcs.SetDLLAccessPath (split_path[i]);
|
funcs.SetDLLAccessPath (split_path[i]);
|
||||||
|
|
||||||
/* now we are done with the split paths, so free them */
|
tmppath = g_strdup_printf ("%s/", split_path[i]);
|
||||||
g_strfreev (split_path);
|
if ((res = funcs.RAOpenCodec2 (&context, tmppath))) {
|
||||||
|
g_free (tmppath);
|
||||||
if ((res = funcs.RAOpenCodec2 (&context, NULL))) {
|
|
||||||
GST_DEBUG_OBJECT (dec, "RAOpenCodec2() failed");
|
|
||||||
goto could_not_initialize;
|
goto could_not_initialize;
|
||||||
}
|
}
|
||||||
|
g_free (tmppath);
|
||||||
|
|
||||||
|
/* now we are done with the split paths, so free them */
|
||||||
|
g_strfreev (split_path);
|
||||||
|
|
||||||
data.samplerate = rate;
|
data.samplerate = rate;
|
||||||
data.width = width;
|
data.width = width;
|
||||||
|
@ -311,16 +314,16 @@ codec_search_done:
|
||||||
data.data = buf ? GST_BUFFER_DATA (buf) : NULL;
|
data.data = buf ? GST_BUFFER_DATA (buf) : NULL;
|
||||||
|
|
||||||
if ((res = funcs.RAInitDecoder (context, &data))) {
|
if ((res = funcs.RAInitDecoder (context, &data))) {
|
||||||
GST_DEBUG_OBJECT (dec, "RAInitDecoder() failed");
|
GST_WARNING_OBJECT (dec, "RAInitDecoder() failed");
|
||||||
goto could_not_initialize;
|
goto could_not_initialize;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (funcs.RASetPwd) {
|
if (funcs.RASetPwd) {
|
||||||
funcs.RASetPwd (dec->context, dec->pwd ? dec->pwd : DEFAULT_PWD);
|
funcs.RASetPwd (context, dec->pwd ? dec->pwd : DEFAULT_PWD);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((res = funcs.RASetFlavor (context, flavor))) {
|
if ((res = funcs.RASetFlavor (context, flavor))) {
|
||||||
GST_DEBUG_OBJECT (dec, "RASetFlavor(%d) failed", flavor);
|
GST_WARNING_OBJECT (dec, "RASetFlavor(%d) failed", flavor);
|
||||||
goto could_not_initialize;
|
goto could_not_initialize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -371,7 +374,7 @@ could_not_initialize:
|
||||||
funcs.RAFreeDecoder (context);
|
funcs.RAFreeDecoder (context);
|
||||||
}
|
}
|
||||||
g_module_close (module);
|
g_module_close (module);
|
||||||
GST_DEBUG_OBJECT (dec, "Initialization of REAL driver failed (%i).", res);
|
GST_WARNING_OBJECT (dec, "Initialization of REAL driver failed (%i).", res);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
could_not_set_caps:
|
could_not_set_caps:
|
||||||
if (context) {
|
if (context) {
|
||||||
|
|
Loading…
Reference in a new issue