@@ -179,6 +179,11 @@ - (void)selectionChanged: (id)object
179179 if (m_current_frame != nil )
180180 CFRelease (m_current_frame);
181181
182+ // MW-2014-07-16: [[ Bug 12506 ]] Make sure we unhook the callbacks before releasing (it
183+ // seems it takes a while for QTKit to actually release the objects!).
184+ MCSetActionFilterWithRefCon ([m_movie quickTimeMovieController ], nil , nil );
185+ SetMovieDrawingCompleteProc ([m_movie quickTimeMovie ], movieDrawingCallWhenChanged, nil , nil );
186+
182187 [[NSNotificationCenter defaultCenter ] removeObserver: m_observer];
183188 [m_observer release ];
184189 [m_view release ];
@@ -506,29 +511,15 @@ inline NSComparisonResult do_QTTimeCompare (QTTime time, QTTime otherTime)
506511
507512void MCQTKitPlayer::LockBitmap (MCImageBitmap*& r_bitmap)
508513{
509- // First get the image from the view - this will have black where the movie
510- // should be.
511-
512- NSRect t_rect;
513- if (m_offscreen)
514- t_rect = NSMakeRect (0 , 0 , m_rect . width, m_rect . height);
515- else
516- t_rect = [m_view frame ];
517-
518- NSRect t_movie_rect;
519- t_movie_rect = [m_view movieBounds ];
520-
521- NSBitmapImageRep *t_rep;
522- t_rep = [m_view bitmapImageRepForCachingDisplayInRect: t_rect];
523- [m_view cacheDisplayInRect: t_rect toBitmapImageRep: t_rep];
524-
525514 MCImageBitmap *t_bitmap;
526515 t_bitmap = new MCImageBitmap;
527- t_bitmap -> width = [t_rep pixelsWide ];
528- t_bitmap -> height = [t_rep pixelsHigh ];
529- t_bitmap -> stride = [t_rep bytesPerRow ];
530- t_bitmap -> data = (uint32_t *)[t_rep bitmapData ];
516+ t_bitmap -> width = m_rect . width;
517+ t_bitmap -> height = m_rect . height;
518+ t_bitmap -> stride = m_rect . width * sizeof (uint32_t );
519+ t_bitmap -> data = (uint32_t *)malloc (t_bitmap -> stride * t_bitmap -> height);
520+ memset (t_bitmap -> data, 0 ,t_bitmap -> stride * t_bitmap -> height);
531521 t_bitmap -> has_alpha = t_bitmap -> has_transparency = true ;
522+
532523
533524 // Now if we have a current frame, then composite at the appropriate size into
534525 // the movie portion of the buffer.
@@ -551,7 +542,7 @@ inline NSComparisonResult do_QTTimeCompare (QTTime time, QTTime otherTime)
551542 CIContext *t_ci_context;
552543 t_ci_context = [CIContext contextWithCGContext: t_cg_context options: nil ];
553544
554- [t_ci_context drawImage: t_ci_image inRect: CGRectMake (0 , t_rect . size . height - t_movie_rect . size . height, t_movie_rect . size . width, t_movie_rect . size . height) fromRect: [t_ci_image extent ]];
545+ [t_ci_context drawImage: t_ci_image inRect: CGRectMake (0 , 0 , m_rect . width, m_rect . height) fromRect: [t_ci_image extent ]];
555546
556547 [t_pool release ];
557548
0 commit comments