From 79b24caa2239affc6fb967de6a456dfb0afd04d4 Mon Sep 17 00:00:00 2001 From: arpi Date: Thu, 23 Aug 2001 11:54:08 +0000 Subject: shmem_alloc->memalign, adding function to free memory git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1653 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpeg2/decode.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'libmpeg2/decode.c') diff --git a/libmpeg2/decode.c b/libmpeg2/decode.c index bb7939db96..9891df6991 100644 --- a/libmpeg2/decode.c +++ b/libmpeg2/decode.c @@ -81,7 +81,7 @@ void mpeg2_init (void) // printf("libmpeg2 config flags = 0x%X\n",config.flags); - picture=shmem_alloc(sizeof(picture_t)); // !!! NEW HACK :) !!! + picture=malloc(sizeof(picture_t)); // !!! NEW HACK :) !!! header_state_init (picture); // picture->repeat_count=0; @@ -114,7 +114,7 @@ void mpeg2_allocate_image_buffers (picture_t * picture) #else for(i=0;i<3;i++){ #endif - base = shmem_alloc(buff_size); + base = memalign(64,buff_size); frames[i].base[0] = base; frames[i].base[1] = base + frame_size * 5 / 4; frames[i].base[2] = base + frame_size; @@ -128,6 +128,19 @@ void mpeg2_allocate_image_buffers (picture_t * picture) } +void mpeg2_free_image_buffers (picture_t * picture){ + int i; + +#ifdef MPEG12_POSTPROC + for(i=0;i<4;i++){ +#else + for(i=0;i<3;i++){ +#endif + free(frames[i].base[0]); + } + +} + static void copy_slice (vo_frame_t * frame, uint8_t ** src){ vo_functions_t * output = frame->vo; int stride[3]; -- cgit v1.2.3