summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-05-12 15:50:40 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-05-12 15:50:40 +0000
commita7654868a0aef49d7d69390e0bafddf5fb224cfa (patch)
tree74f7fa929562dbcf60215821a2a71c8ca59606d3 /libmpcodecs
parent6932244e6ce71ec8548a36d86d0e2e60e7ef7cf1 (diff)
downloadmpv-a7654868a0aef49d7d69390e0bafddf5fb224cfa.tar.bz2
mpv-a7654868a0aef49d7d69390e0bafddf5fb224cfa.tar.xz
use dynamic path[] allocation and possible better wraSetDLLAccessPath mechanism :)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10102 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/ad_realaud.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libmpcodecs/ad_realaud.c b/libmpcodecs/ad_realaud.c
index 998afcbfb9..4e5f542209 100644
--- a/libmpcodecs/ad_realaud.c
+++ b/libmpcodecs/ad_realaud.c
@@ -211,8 +211,10 @@ static int preinit(sh_audio_t *sh){
unsigned int result;
int len=0;
void* prop;
- char path[4096];
+ char *path;
+ path = malloc(strlen(REALCODEC_PATH)+strlen(sh->codec->dll)+2);
+ if (!path) return 0;
sprintf(path, REALCODEC_PATH "/%s", sh->codec->dll);
/* first try to load linux dlls, if failed and we're supporting win32 dlls,
@@ -226,6 +228,7 @@ static int preinit(sh_audio_t *sh){
{
mp_msg(MSGT_DECVIDEO, MSGL_ERR, MSGTR_MissingDLLcodec, sh->codec->dll);
mp_msg(MSGT_DECVIDEO, MSGL_HINT, "Read the RealAudio section of the DOCS!\n");
+ free(path);
return 0;
}
@@ -234,7 +237,9 @@ static int preinit(sh_audio_t *sh){
#else
if(raSetDLLAccessPath){
#endif
+ int i;
// used by 'SIPR'
+ path = realloc(path, strlen(REALCODEC_PATH) + 12);
sprintf(path, "DT_Codecs=" REALCODEC_PATH);
if(path[strlen(path)-1]!='/'){
path[strlen(path)+1]=0;
@@ -243,7 +248,11 @@ static int preinit(sh_audio_t *sh){
path[strlen(path)+1]=0;
#ifdef USE_WIN32DLL
if (dll_type == 1)
+ {
+ for (i=0; i < strlen(path); i++)
+ if (path[i] == '/') path[i] = '\\';
wraSetDLLAccessPath(path);
+ }
else
#endif
raSetDLLAccessPath(path);
@@ -266,6 +275,7 @@ static int preinit(sh_audio_t *sh){
return 0;
}
// printf("opencodec ok (result: %x)\n", result);
+ free(path); /* after this it isn't used anymore */
sh->samplerate=sh->wf->nSamplesPerSec;
sh->samplesize=sh->wf->wBitsPerSample/8;