struct vo_postprocess_state *vo_postprocess_init(char *config_string)
{
        struct vo_postprocess_state *s;
        char *vo_postprocess_options = NULL;

        if(!config_string) 
                return NULL;

        if(strcmp(config_string, "help") == 0)
        {
                show_vo_postprocess_help();
                return NULL;
        }

        s = (struct vo_postprocess_state *) malloc(sizeof(struct vo_postprocess_state));
        s->handle = NULL;
        int i;
        for(i = 0; vo_postprocess_modules[i].name != NULL; ++i) {
                if(strncasecmp(config_string, vo_postprocess_modules[i].name,
                                        strlen(vo_postprocess_modules[i].name)) == 0) {
                        /* found it */
#ifdef BUILD_LIBRARIES
                        if(vo_postprocess_modules[i].library_name) {
                                vo_postprocess_modules[i].handle =
                                        vo_pp_open_library(vo_postprocess_modules[i].library_name);
                                if(!vo_postprocess_modules[i].handle) {
                                        free(s);
                                        fprintf(stderr, "Unable to load postprocess library.\n");
                                        return NULL;
                                }
                                int ret = vo_pp_fill_symbols(&vo_postprocess_modules[i]);
                                if(!ret) {
                                        free(s);
                                        fprintf(stderr, "Unable to load postprocess library.\n");
                                        return NULL;
                                }
                        }
#endif /* BUILD_LIBRARIES */
                        s->handle = &vo_postprocess_modules[i];
                        if(config_string[strlen(vo_postprocess_modules[i].name)] == ':') 
                                vo_postprocess_options = config_string +
                                        strlen(vo_postprocess_modules[i].name) + 1;
                }
        }
        if(!s->handle) {
                fprintf(stderr, "Unknown postprocess module: %s\n", config_string);
                free(s);
                return NULL;
        }
        s->state = s->handle->init(vo_postprocess_options);
        if(!s->state) {
                fprintf(stderr, "Postprocessing initialization failed: %s\n", config_string);
                free(s);
                return NULL;
        }
        return s;
}
struct vo_postprocess_state *vo_postprocess_init(char *config_string)
{
        struct vo_postprocess_state *s;
        char *vo_postprocess_options = NULL;
        
        if(!config_string) 
                return NULL;
        
        if(strcmp(config_string, "help") == 0)
        {
                show_vo_postprocess_help();
                return NULL;
        }
        
        s = (struct vo_postprocess_state *) malloc(sizeof(struct vo_postprocess_state));
        s->handle = NULL;
        int i;
        for(i = 0; vo_postprocess_modules[i].name != NULL; ++i) {
                if(strncasecmp(config_string, vo_postprocess_modules[i].name,
                                strlen(vo_postprocess_modules[i].name)) == 0) {
                        s->handle = &vo_postprocess_modules[i];
                        if(config_string[strlen(vo_postprocess_modules[i].name)] == ':') 
                                        vo_postprocess_options = config_string +
                                                strlen(vo_postprocess_modules[i].name) + 1;
                }
        }
        if(!s->handle) {
                fprintf(stderr, "Unknown postprocess module: %s\n", config_string);
                free(s);
                return NULL;
        }
        s->state = s->handle->init(vo_postprocess_options);
        if(!s->state) {
                fprintf(stderr, "Postprocessing initialization failed: %s\n", config_string);
                free(s);
                return NULL;
        }
        return s;
}