set_subcategory( SUBCAT_INPUT_VCODEC );
set_callbacks( Open, Close );
- /* create a mutex */
- var_Create( p_module->p_libvlc, "qt_mutex", VLC_VAR_MUTEX );
vlc_module_end();
{
decoder_t *p_dec = (decoder_t*)p_this;
+ /* create a mutex */
+ var_Create( p_this->p_libvlc, "qt_mutex", VLC_VAR_MUTEX );
+
switch( p_dec->fmt_in.i_codec )
{
case VLC_FOURCC('S','V','Q','3'): /* Sorenson v3 */
/* get lock, avoid segfault */
var_Get( p_dec->p_libvlc, "qt_mutex", &lockval );
vlc_mutex_lock( lockval.p_address );
-#ifdef __APPLE__
- /* on OS X QT is not threadsafe */
- vlc_mutex_lock( &p_dec->p_vlc->quicktime_lock );
-#endif
if( p_dec->fmt_out.i_cat == AUDIO_ES )
{
}
else if( p_dec->fmt_out.i_cat == VIDEO_ES )
{
- if( p_sys->plane) free( p_sys->plane );
+ if( p_sys->plane) free( p_sys->plane );
}
#ifndef __APPLE__
#endif
#endif
-#ifdef __APPLE__
- vlc_mutex_unlock( &p_dec->p_vlc->quicktime_lock );
-#endif
vlc_mutex_unlock( lockval.p_address );
+ var_Destroy( p_dec->p_libvlc, "qt_mutex" );
- free( p_sys );
+ if( p_sys ) free( p_sys );
}
/*****************************************************************************
/* get lock, avoid segfault */
var_Get( p_dec->p_libvlc, "qt_mutex", &lockval );
vlc_mutex_lock( lockval.p_address );
-#ifdef __APPLE__
- /* on OS X QT is not threadsafe */
- vlc_mutex_lock( &p_dec->p_vlc->quicktime_lock );
-#endif
#ifdef __APPLE__
EnterMovies();
p_sys->i_out = 0;
p_sys->i_out_frames = 0;
-#ifdef __APPLE__
- vlc_mutex_unlock( &p_dec->p_vlc->quicktime_lock );
-#endif
vlc_mutex_unlock( lockval.p_address );
return VLC_SUCCESS;
#ifdef LOADER
Restore_LDT_Keeper( p_sys->ldt_fs );
-#endif
-#ifdef __APPLE__
- vlc_mutex_unlock( &p_dec->p_vlc->quicktime_lock );
#endif
vlc_mutex_unlock( lockval.p_address );
memset( &icap, 0, sizeof( ImageSubCodecDecompressCapabilities ) );
cres = p_sys->ImageCodecInitialize( p_sys->ci, &icap );
msg_Dbg( p_dec, "ImageCodecInitialize->0x%X size=%d (%d)\n",
- (int)cres, icap.recordSize, icap.decompressRecordSize);
+ (int)cres, (int)icap.recordSize, (int)icap.decompressRecordSize);
memset( &cinfo, 0, sizeof( CodecInfo ) );
cres = p_sys->ImageCodecGetCodecInfo( p_sys->ci, &cinfo );
msg_Dbg( p_dec,
- "Flags: compr: 0x%x decomp: 0x%x format: 0x%x\n",
- cinfo.compressFlags,
- cinfo.decompressFlags, cinfo.formatFlags );
+ "Flags: compr: 0x%x decomp: 0x%x format: 0x%x\n",
+ (unsigned int)cinfo.compressFlags,
+ (unsigned int)cinfo.decompressFlags,
+ (unsigned int)cinfo.formatFlags );
msg_Dbg( p_dec, "quicktime_video: Codec name: %.*s\n",
((unsigned char*)&cinfo.typeName)[0],
((unsigned char*)&cinfo.typeName)+1 );
msg_Dbg( p_dec, "idSize=%d ver=%d rev=%d vendor=%d tempQ=%d "
"spaQ=%d w=%d h=%d dpi=%d%d dataSize=%d depth=%d frameCount=%d clutID=%d",
- id->idSize, id->version, id->revisionLevel, id->vendor,
+ (int)id->idSize, id->version, id->revisionLevel, (int)id->vendor,
(int)id->temporalQuality, (int)id->spatialQuality,
- id->width, id->height,
+ (int)id->width, (int)id->height,
(int)id->hRes, (int)id->vRes,
(int)id->dataSize,
id->depth,
id->frameCount,
id->clutID );
- p_sys->framedescHandle =
- (ImageDescriptionHandle) p_sys->NewHandleClear( id->idSize );
+ p_sys->framedescHandle = (ImageDescriptionHandle) NewHandleClear( id->idSize );
memcpy( *p_sys->framedescHandle, id, id->idSize );
p_sys->plane = malloc( p_dec->fmt_in.video.i_width * p_dec->fmt_in.video.i_height * 3 );
&p_sys->OutBufferRect,
0, 0, 0,
p_sys->plane,
- (long)p_dec->fmt_in.video.i_width * 2 );
+ p_dec->fmt_in.video.i_width * 2 );
msg_Dbg( p_dec, "NewGWorldFromPtr returned:%ld\n",
65536 - ( i_result&0xffff ) );
return NULL;
}
p_block = *pp_block;
-
- if( !p_block->i_buffer )
- {
- block_Release( p_block );
- return NULL;
- }
+ *pp_block = NULL;
i_pts = p_block->i_pts ? p_block->i_pts : p_block->i_dts;
{
p_sys->i_late = 0;
}
- msg_Dbg( p_dec, "bufsize: %d",p_block->i_buffer);
+ msg_Dbg( p_dec, "bufsize: %d", p_block->i_buffer);
if( p_sys->i_late > 10 )
{
p_dec->fmt_in.video.i_width * p_dec->fmt_in.video.i_height * 2 );
p_pic->date = i_pts;
}
- else
vlc_mutex_unlock( lockval.p_address );