view m_config.h @ 16829:c1aabebbe2e7

honor decoder's/filter's decision to remove frames when using -noskip. this may go against the original intention of the vf layer, but it's how all the filters that drop frames have been written to work, so it's now the de-facto standard. without this patch, -noskip will result in tons of duplicate frames (either soft or hard duplicates) and a/v desync whenever decimation, ivtc, etc. is used. even with this patch -noskip is still a bad idea for most of these purposes, but it will work reliably with filmdint, framestep, and some other filters with fixed in:out ratios as long as the right -ofps value is used. without this patch, there is no hope of -noskip working with frame-dropping filters. (this patch was previously committed erroneously as part of another change, then reversed. it is now being committed again.)
author rfelker
date Sun, 23 Oct 2005 07:37:55 +0000
parents 5dea9e3618ba
children 63909962d3fc
line wrap: on
line source

#ifndef _M_CONFIG_H
#define _M_CONFIG_H

typedef struct m_config_option m_config_option_t;
typedef struct m_config_save_slot m_config_save_slot_t;
struct m_option;
struct m_option_type;

struct m_config_save_slot {
  m_config_save_slot_t* prev;
  int lvl;
  // we have to store other datatypes in this as well,
  // so make sure we get properly aligned addresses
  unsigned char data[0] __attribute__ ((aligned (8)));
};

struct m_config_option {
  m_config_option_t* next;
  char* name; // Full name (ie option:subopt)
  struct m_option* opt;
  m_config_save_slot_t* slots;
  unsigned int flags; // currently it only tell if the option was set
};

typedef struct m_config {
  m_config_option_t* opts;
  int lvl; // Current stack level
  int mode;
} m_config_t;

#define M_CFG_OPT_SET    (1<<0)
#define M_CFG_OPT_ALIAS  (1<<1)


//////////////////////////// Functions ///////////////////////////////////

m_config_t*
m_config_new(void);

void
m_config_free(m_config_t* config);

void
m_config_push(m_config_t* config);

void
m_config_pop(m_config_t* config);

int
m_config_register_options(m_config_t *config, struct m_option *args);

int
m_config_set_option(m_config_t *config, char* arg, char* param);

int
m_config_check_option(m_config_t *config, char* arg, char* param);

struct m_option*
m_config_get_option(m_config_t *config, char* arg);

void
m_config_print_option_list(m_config_t *config);

#endif /* _M_CONFIG_H */