[MPlayer-users] [patch] gmplayer segfaults when playing an audio file the 3rd time

Felix Kühling fxkuehl at gmx.de
Tue Feb 4 19:47:28 CET 2003


Hi,

gmplayer of MPlayer-0.90rc3 segfaults when starting an audio file the
3rd time. It segfaults on line mplayer.c:3093. osd_level was == 1 even
though sh_video==NULL. The cause seems to be this construct around line
mplayer.c:1580:

// If there is no video OSD has to be disabled.
// In case of playing a playtree we have to restore the
// old OSD level after playing one or more audio-only files.
if(!sh_video && osd_level > 0) { // save OSD level only once
    osd_level_saved = osd_level;
    osd_level = 0;
} else if (osd_level_saved > -1) { // if there is a saved OSD level, restore it
    osd_level = osd_level_saved;
    osd_level_saved = -1;
}

If osd_level == 0 && osd_level_saved > -1 the else branch is entered and
a non-zero osd_level is restored even if sh_video==NULL. So you have to
check sh_video in the else if condition, too.

--- mplayer.c~  2003-01-19 01:21:39.000000000 +0100
+++ mplayer.c   2003-02-04 19:27:36.000000000 +0100
@@ -1580,7 +1580,7 @@
 if(!sh_video && osd_level > 0) { // save OSD level only once
     osd_level_saved = osd_level;
     osd_level = 0;
-} else if (osd_level_saved > -1) { // if there is a saved OSD level, restore it
+} else if (sh_video && osd_level_saved > -1) { // if there is a saved OSD level, restore it
     osd_level = osd_level_saved;
     osd_level_saved = -1;
 }

Anyway, I do appreciate the great work you guys are doing!

Best regards,
  Felix

               __\|/__    ___     ___     ___
__Tschüß_______\_6 6_/___/__ \___/__ \___/___\___You can do anything,___
_____Felix_______\Ä/\ \_____\ \_____\ \______U___just not everything____
  fxkuehl at gmx.de    >o<__/   \___/   \___/        at the same time!



More information about the MPlayer-users mailing list