Skip to content
This repository was archived by the owner on Jun 11, 2020. It is now read-only.
This repository was archived by the owner on Jun 11, 2020. It is now read-only.

When using the player inside a program, memory isn't freed afterwards. #22

@solarstrings

Description

@solarstrings

Hi!

I took the player (tutorial07.c), changed the main into: playVideoFile(char *filename); by simply exchanging argv to filename. Everything works, but when exiting the player function, the memory isn't freed.

In order to get audio to play the second time you want to play a movie within your program, you need to call SDL_CloseAudio(); in the SDL_QUIT event, like so:

        case SDL_QUIT:
            SDL_CloseAudio();
            is->quit = 1;

otherwise the audio won't play the 2nd time you start a video.

I'm trying to find what memory to free, but I'm new to thread programming (just started learning them by writing a web server in C for a Lab at the university), so I haven't found what to free yet.

When playing a video, it allocates the memory it needs, then stays there. And when closing down the
video, the memory is still allocated, in my case around 72Mb

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions