[MPlayer-dev-eng] [PATCH] [MPlayer OSX] Support open another file while playing

Ulion ulion2002 at gmail.com
Sat Oct 27 18:37:29 CEST 2007


2007/10/24, Ulion <ulion2002 at gmail.com>:
> 2007/10/23, Diego Biurrun <diego at biurrun.de>:
> > On Tue, Oct 23, 2007 at 11:01:40PM +0800, Ulion wrote:
> > >
> > > To make new task not affect by previous task's notification, we need
> > > to remove observers before start new task. Here's the patch.
> >
> > some nits below..
> >
> > > --- Sources/Classes/MplayerInterface.m        (revision 140)
> > > +++ Sources/Classes/MplayerInterface.m        (working copy)
> > > @@ -874,7 +874,10 @@
> > >               [self stop];
> > > +             // Remove observers to not recieve notifications.
> >
> > recEIve
>
> Which copied from some place of that file, fixed.
>
> >
> > > @@ -959,10 +962,16 @@
> > >
> > > +     // Task only terminate once.
> >
> > Terminate task only once.
> >
>
> Fixed.
>
> I also made some test on intel mac platform, the reopen operations
> sometimes crash MPlayer OSX, in the log it said:
>
> > MPlayer OSX[489] Failed to get shared memory id from mplayer (shmget)
>
> After some test, I think this patch also fix the crash problem.
>
> Here's the comment fixed patch.
>

Improved patch, prevent starting new task before previous task stop or
finish, saving item info and play it until previous task really ends.

With original code or previous patches, sometimes mplayer osx will
fail to loadInfo of a media file, caused by myPlayingItem is set to
nil when playercontroller receive stop/finish notify from
mplayerinterface, but this notifaction can occur in the progress of
starting to play an new item, set it to nil will erase the starting
item's myPlayingItem and make it load info failed.
Correct fix is to make sure only start playing new item after
stop/finish notifaction already received (only when myPlayingItem is
nil)

And this patch also adjust some code order in terminateMplayer, to
send notifaction to controller at last of the function to prevent from
double implement of the function. Read the return code first to make
sure the myMplayerTask is the one we expected.

-- 
Ulion
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayerosx_reopen_fix3.diff
Type: text/x-diff
Size: 3583 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20071028/c3829728/attachment.diff>


More information about the MPlayer-dev-eng mailing list