~devvmh/mnemosyne-proj/mnemosyne-proj

« back to all changes in this revision

Viewing changes to mnemosyne/mnemosyne/pyqt_ui/review_wdgt.py

  • Committer: Devin Howard
  • Date: 2017-04-25 03:41:38 UTC
  • Revision ID: devin@callysto.com-20170425034138-492pcwqfkbc6pjz4
fix mplayer error in 2.4.1 on MacOS

Show diffs side-by-side

added added

removed removed

Lines of Context:
506
506
            command = "mplayer.exe -slave -ao win32 -quiet \"" + filename + \
507
507
                "\" -ss " + str(start) + " -endpos " + str(duration) 
508
508
        elif sys.platform == "darwin":
509
 
            command = "mplayer -slave -ao coreaudio -quiet \"" + filename + \
510
 
                "\" -ss " + str(start) + " -endpos " + str(duration)
 
509
            # e.g. /path/to/Mnemosyne.app/Contents/MacOS/mnemosyne/pyqt_ui/review_wdgt.py
 
510
            SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__))
 
511
            # e.g. /path/to/Mnemosyne.app/Contents
 
512
            CONTENTS_FOLDER = SCRIPT_PATH[:SCRIPT_PATH.index("/MacOS")]
 
513
            # e.g. /path/to/Mnemosyne.app/Contents/MacOS/mplayer
 
514
            MPLAYER_PATH = CONTENTS_FOLDER + "/MacOS/mplayer"
 
515
 
 
516
            command = "{} -slave -ao coreaudio -quiet \"{}\" -ss {} -endpos {}".format(
 
517
                MPLAYER_PATH, filename, str(start), str(duration)
 
518
            )
511
519
        else:
512
520
            command = "mplayer -slave -quiet \"" + filename + \
513
521
                "\" -ss " + str(start) + " -endpos " + str(duration)