static int enc_add_attr(MSFilter *f, void *arg){ const char *attr=(const char *)arg; if (strstr(attr,"ptime:")!=NULL){ int ptime = atoi(attr+6); return set_ptime(f,ptime); } return 0; }
static int enc_add_fmtp(MSFilter *f, void *arg){ const char *fmtp=(const char *)arg; char tmp[30]; if (fmtp_get_value(fmtp,"ptime",tmp,sizeof(tmp))){ return set_ptime(f,atoi(tmp)); } return 0; }
/* this is now located in maccel.s */ void set_cookie( void ) { int count; JAR_ENTRY *pjar, *qjar; /* set up park time first (no better place to do it) */ get_parktime(); if( parktime >= 0 ) parktime = ma_info->savepark; set_ptime(); pjar = p_cookies; if( !pjar ) { /* no jar found, set one up */ qjar = p_cookies = cookie_jar; qjar->cookie = COOKIE; qjar->value = (long)ma_info; ++qjar; qjar->cookie = 0L; qjar->value = JARSIZE; } else { /* find the end of the cookie jar */ for( count = 0; pjar[count].cookie; ++count ); if( pjar[count].value < count ) { /* there's room in the jar */ pjar[count+1].cookie = 0L; pjar[count+1].value = pjar[count].value; pjar[count].cookie = COOKIE; pjar[count].value = (long)ma_info; } else { /* no room, copy the jar to cookie_jar */ qjar = p_cookies = cookie_jar; while( pjar->cookie ) *qjar++ = *pjar++; qjar->cookie = COOKIE; qjar->value = (long)ma_info; ++qjar; qjar->cookie = 0L; qjar->value = JARSIZE; } } }