@@ -284,7 +284,7 @@ void MCMultimediaEvalSound(MCExecContext& ctxt, MCStringRef& r_sound)
284284#ifndef FEATURE_PLATFORM_AUDIO
285285 MCU_play ();
286286#endif
287- if (MCacptr != nil && MCacptr -> isPlaying ())
287+ if (MCacptr && MCacptr -> isPlaying ())
288288 {
289289 MCacptr -> getstringprop (ctxt, 0 , P_NAME, False, r_sound);
290290 return ;
@@ -608,8 +608,8 @@ void MCMultimediaExecPlayAudioClip(MCExecContext& ctxt, MCStack *p_target, int p
608608
609609 MCNewAutoNameRef t_clipname;
610610 /* UNCHECKED */ MCNameCreate (p_clip, &t_clipname);
611- if ((MCacptr = ( MCAudioClip *) (sptr->getAV ((Chunk_term)p_chunk_type, p_clip, CT_AUDIO_CLIP))) == NULL &&
612- (MCacptr = ( MCAudioClip *) (sptr->getobjname (CT_AUDIO_CLIP, *t_clipname))) == NULL )
611+ if (! (MCacptr = MCObjectCast< MCAudioClip> (sptr->getAV ((Chunk_term)p_chunk_type, p_clip, CT_AUDIO_CLIP)))
612+ && ! (MCacptr = MCObjectCast< MCAudioClip> (sptr->getobjname (CT_AUDIO_CLIP, *t_clipname))))
613613 {
614614 IO_handle stream;
615615
@@ -634,15 +634,15 @@ void MCMultimediaExecPlayAudioClip(MCExecContext& ctxt, MCStack *p_target, int p
634634 MCS_close (stream);
635635 MCresult->sets (" error reading audioClip" );
636636 delete MCacptr;
637- MCacptr = NULL ;
637+ MCacptr = nil ;
638638 ctxt . Throw ();
639639 return ;
640640 }
641641 MCS_close (stream);
642642 }
643643 MCacptr->setlooping (p_looping);
644644 MCU_play ();
645- if (MCacptr != NULL )
645+ if (MCacptr)
646646 MCscreen->addtimer (MCacptr, MCM_internal, p_looping ? LOOP_RATE : PLAY_RATE);
647647}
648648
0 commit comments