[MPlayer-cvslog] r26109 - trunk/stream/cache2.c

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Feb 28 17:57:44 CET 2008


> @@ -227,20 +231,23 @@ cache_vars_t* cache_init(int size,int se
>  void cache_uninit(stream_t *s) {
>    cache_vars_t* c = s->cache_data;
>    if(!s->cache_pid) return;
> -#ifndef WIN32
> +#ifdef WIN32
> +  TerminateThread((HANDLE)s->cache_pid,0);
> +#elif defined(__OS2__)
> +  DosKillThread( s->cache_pid );
> +  DosWaitThread( &s->cache_pid, DCWW_WAIT );
> +#else
>    kill(s->cache_pid,SIGKILL);
>    waitpid(s->cache_pid,NULL,0);
> -#else
> -  TerminateThread((HANDLE)s->cache_pid,0);
> -  free(c->stream);
>  #endif
>    if(!c) return;
> -#ifndef WIN32
> -  shmem_free(c->buffer,c->buffer_size);
> -  shmem_free(s->cache_data,sizeof(cache_vars_t));
> -#else
> +#if defined(WIN32) || defined(__OS2__)
> +  free(c->stream);
>    free(c->buffer);
>    free(s->cache_data);
> +#else
> +  shmem_free(c->buffer,c->buffer_size);
> +  shmem_free(s->cache_data,sizeof(cache_vars_t));
>  #endif

Not a big deal, but you mixed a bug fix into that, in the old code
c->stream was used before the !c check.



More information about the MPlayer-cvslog mailing list