[MPlayer-users] Re: Bugreport SIGSEGV => get_path()

Martin Oberzalek kingleo at gmx.at
Tue Jan 6 15:30:52 CET 2004


Am Montag, 5. Januar 2004 17:25 schrieb Alban Bedel:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> Hi Martin Oberzalek,
>
> on Mon, 5 Jan 2004 09:09:31 +0100 you wrote:
> > Hello, I found a bug:
> > [ ... ]
> > get_path() returns NULL if $HOME is not set. And this is the case if you
> > call mplayer via apache => php => exec().
>
> This is a kinda uncommon case. So if you want to see that fixed you
> should send a (good ;) patch 

A two liner is always a good patch

> to the dev list (see the docs for details).
> But as get_path is used in various places, imho you should just set
> $HOME.

I detected, only this one line has to be changed. And I cannot let mplayer 
crash anymore :)

--- mplayer.c   Mon Dec  8 22:33:31 2003
+++ mplayer-new.c       Tue Jan  6 15:21:54 2004
@@ -1623,21 +1623,22 @@
 if(sh_video) {
 // after reading video params we should load subtitles because
 // we know fps so now we can adjust subtitles time to ~6 seconds AST
 // check .sub
   current_module="read_subtitles_file";
   if(sub_name){
     for (i = 0; sub_name[i] != NULL; ++i)
         add_subtitles (sub_name[i], sh_video->fps, 0);
   }
   if(sub_auto) { // auto load sub file ...
-    char **tmp = sub_filenames(get_path("sub/"), filename);
+    char *psub = get_path( "sub/" );
+    char **tmp = sub_filenames( (psub ? psub : ""), filename);
     char **tmp2 = tmp;
     while (*tmp2)
         add_subtitles (*tmp2++, sh_video->fps, 0);
     free(tmp);
     if (set_of_sub_size == 0)
         add_subtitles (get_path("default.sub"), sh_video->fps, 1);
     if (set_of_sub_size > 0)
         add_subtitles (NULL, sh_video->fps, 1);
   }
   if (set_of_sub_size > 0)  {

Greetings, Martin!

-- 
Enie Sdutie der Uni Cgabdmire hat ftetelesgslt, dsas man die Beatsubhcn
eeins Wtoers, bis auf den Anngafs- und Euacdebbtshnn, keptmolt veeedrhrn
knan und der Txet tdtoerzm ncoh lasebr ist.
                           http://kingleo.pages.at/index_shuffle.xml.php




More information about the MPlayer-users mailing list